This upstream Chromium browser test intermittently fails in Brave
builds due to the same root cause as the already-disabled
PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed:
Brave's cosmetic filters inject a MutationObserver and setInterval
(500ms) polling on all pages, generating continuous renderer tasks
that prevent the IdlenessDetector's 500ms quiet window from completing
before the 4-second page stability timeout fires.
The test expects kNetworkAndMainThread outcome (bucket 1) but gets
kTimeout (bucket 5) because NetworkBecameIdle is never signaled.
Upstream flake rate is 1% over 30 days per LUCI Analysis. Not
disabled upstream. Brave modifications exist in the actor directory
via chromium_src but do not affect page stability monitoring.
Resolves https://github.com/brave/brave-browser/issues/54205
Disable flaky PersistentBackground/ExtensionModuleApiTest.CognitoFile/0
This Chromium test intermittently times out on Windows CI because
Brave's additional startup services keep the UI thread non-idle,
causing RunUntilIdle() to exceed the 30-second timeout. The test
exercises purely upstream extension module API code with no Brave
modifications. Upstream flake rate: 0.2% (stable).
Resolves https://github.com/brave/brave-browser/issues/54187
Co-authored-by: Brian R. Bondy <netzen@gmail.com>
Brave's cosmetic filters inject MutationObserver and setInterval(500ms)
polling on all pages, preventing Blink's IdlenessDetector from reaching
the 500ms quiet window needed for NetworkBecameIdle. The Paint test
waits for the network/main-thread idle histogram after paint stability
wins the race, but the idle task never fires due to continuous renderer
activity from cosmetic filters.
This is a Chromium test (chrome/browser/actor/tools/
page_stability_metrics_browsertest.cc). Not disabled upstream. Upstream
flake rate is 3.8% (LUCI Analysis, 30 days). Brave has chromium_src
overrides in chrome/browser/actor/ (site_policy.cc,
actor_proto_conversion.cc) but these do not affect page stability
monitoring. Same root cause as the already-disabled
PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed (Linux)
and PageStabilityMetricsTest.NetworkAndMainThreadIdle (Linux, PR #35281).
Resolves https://github.com/brave/brave-browser/issues/54186
Users who had hidden the search input before the chat input
feature was added would unexpectedly see the chat input on
upgrade. Default the chat input pref to hidden if they've
explicitly hidden the search input.
* Hide TabSearchContainer in horizontal tab strip region
When we have tab search button on toolbar, we should not show the
the tab search container in horizontal tab strip region view.
It's duplicated UI and it's not working - clicking it leads to crash
Resolvesbrave/brave-browser#54199
The hover card should sit to the right of the strip in vertical-tab mode (LEFT_TOP).
Brave only set the bubble arrow in BraveTabHoverCardController when the card
was created or when orientation changed.
Chromium keeps the arrow in sync from anchor_target->GetAnchorPosition() on every update,
so BraveTab still reporting TOP_LEFT could overwrite the correct arrow.
Override BraveTab::GetAnchorPosition() to return LEFT_TOP when vertical tabs are enabled,
otherwise use Tab::GetAnchorPosition().
Remove the controller’s SetIsVerticalTabs / UpdateHoverCardArrow path and the BraveTabStrip call.
TEST=BraveTabTest.GetAnchorPositionReflectsTabOrientation
Disable Chromium test SaveToDriveEventDispatcherBrowserTest.GetFileMetadataStringForUploadInProgress/0
This is an upstream Chromium test with a known 3.4% flake rate
(112k+ verdicts over 30 days). The test times out during PDF
extension host loading in SetUpOnMainThread. No Brave modifications
exist in chrome/browser/save_to_drive/.
Resolves https://github.com/brave/brave-browser/issues/54219
Co-authored-by: Brian R. Bondy <netzen@gmail.com>
GetDesktopName() hardcoded brave-browser-*.desktop for all builds,
ignoring the IS_BRAVE_ORIGIN_BRANDED buildflag. This caused the
running binary to report a different .desktop name than the one
installed by the package (brave-origin-*.desktop), making the window
manager group Brave Origin windows with regular Brave in the taskbar.
Disable Chromium test SensitivePaymentRedactionMultiSourcePageContextFetcherBrowserTest.BasicRedactionInIframe
Known upstream flake with 8.2% flake rate (30-day lookback from LUCI
Analysis). Race condition between autofill form classification and APC
(Annotated Page Content) extraction in cross-site iframe scenarios:
GetAutofillFieldData() returns nullopt when autofill hasn't cached the
iframe's form yet, causing no bounding boxes to be generated for
screenshot redaction. Not disabled by Chromium upstream. No Brave
chromium_src modifications in this code path.
Resolves https://github.com/brave/brave-browser/issues/54104
Disable Chromium test CopyLinkTextTouchTextOnly/LinkPreviewDisabled on Windows
This is an upstream Chromium test that intermittently times out
during browser startup on Windows CI. The test itself is trivially
simple (creates a context menu and checks a menu item), but the
failure occurs before the test body runs -- RunLoop::Run() times
out in ProxyRunTestOnMainThreadLoop during flush_startup_tasks.
Brave's additional startup initialization (AiChat, NTP background
images, stats updater, shields, etc.) adds overhead that can push
startup past the timeout on resource-constrained CI (32 parallel
jobs). Upstream flake rate is 0.3% (stable by Chromium standards).
Not disabled upstream. Brave modifies render_view_context_menu via
chromium_src but only adds menu items, unrelated to startup timing.
Added to browser_tests-windows.filter (platform-specific) since the
failure was only reported on Win x64.
Resolves https://github.com/brave/brave-browser/issues/54114
Co-authored-by: Brian R. Bondy <netzen@gmail.com>
Disable Chromium test ObservationDelayControllerTest.UsePageStabilityForSameDocumentNavigation
This is an upstream Chromium test in chrome/browser/actor/tools/.
The test fixture sets kGlicActorPageStabilityTimeout to 30s to prevent
flakes but does not set kActorObservationDelayTimeout, which defaults
to 10s. On slow CI, the 10s overall timeout fires while still in
kWaitForPageStability, causing the state to skip kWaitForLoadCompletion
and jump directly to kDone.
Upstream LUCI Analysis shows 0.5% flake rate over 30 days. No Brave
chromium_src overrides affect the ObservationDelayController code path.
Fix: brave/brave-browser#54159
Brave's canvas farbling (PerturbPixels) modifies getImageData() results,
breaking this upstream Chromium test's canvas-based video playback
detection. The video_detector.js fingerprinting relies on stable pixel
data from getImageData(), which canvas farbling intentionally perturbs.
Not disabled by Chromium upstream. Upstream flake rate: 0.2% (30-day
LUCI). Other variants (Capture/0, Capture/1, Capture/640x480) are
already disabled for the same reason.
Resolvesbrave/brave-browser#54152
This is an upstream Chromium test. Stable upstream (0.3% flake rate
over 30 days per LUCI Analysis). The test evaluates a console
expression with a sourceMappingURL comment and waits for
SourceMapWillAttach to fire within a hardcoded 20-second JS timeout.
Combined with Brave's DevTools startup overhead (chromium_src
overrides, NTP/stats services), MSAN instrumentation causes the
DevTools frontend initialization to exceed this timeout.
Not disabled by Chromium upstream. Brave modifies DevTools via
chromium_src overrides (url_constants, features, devtools_ui_controller)
which add initialization overhead. No Brave modifications to the source
map manager or test code paths.
Resolves https://github.com/brave/brave-browser/issues/53990
country_resource_component_registrar_ is a singleton in
ResourceComponent, shared across all profiles. When Profile A launches
and downloads the NTT component, OnComponentReady fires and
last_install_dir_ is cached.
Later, when Profile B launches and its AdsServiceImpl calls
RegisterResourceComponentsForCurrentCountryCode, RegisterResourceComponent
is invoked with the same country code. Since the component updater sees
the component is already registered with the same ID, OnComponentReady
does not fire again, so Profile B’s observer is never notified.
With this fix, RegisterResourceComponent detects that last_install_dir_
is already set and immediately calls OnResourceComponentRegistered.
This re-triggers the async manifest/resource loading and
NotifyResourceComponentDidChange, notifying all current observers
including Profile B’s newly added AdsServiceImpl with the current
resource metadata.
This fix also benefits language_resource_component_registrar_ for
notification ads at no additional cost.
This Chromium test fails because the Glic WebUI creates its webview
asynchronously via JavaScript, and Brave's browser environment does
not fully support the Glic WebUI initialization flow. The test
navigates to chrome://glic/ and expects a guest view to be created,
but the async JS initialization sometimes fails to produce the
webview in Brave's context.
The test is stable upstream (0.3% flake rate per LUCI Analysis over
30 days). Not disabled by Chromium. No Brave chromium_src overrides
exist for glic or guest_view code. Failure is reported only on Linux.
Resolves https://github.com/brave/brave-browser/issues/54010
The Origin settings page was showing for both branded builds
(is_brave_origin_branded=true) and upgrade purchases. It should
only show when the user has purchased the Origin upgrade.
The test intermittently fails on Windows x64 ASAN builds because
Brave's tab_data.cc override unconditionally marks UNLOADED tabs with
should_show_discard_status=true. During browser startup, tabs briefly
have UNLOADED state before loading begins, which triggers the discard
ring IPH code path while BrowserUserEducationInterface is still in
kInitializationPending state.
Refine the check to only mark tabs as showing discard status when they
have a real committed navigation entry (not the initial entry). This
preserves the behavior for session-restored tabs and genuinely
discarded tabs while avoiding the IPH trigger during startup.
Resolvesbrave/brave-browser#54040
* Fix AutofillCounterTest.TimeRanges deadlock with FlushForTesting
Brave's background services (AI Chat, etc.) trigger D-Bus operations
during browser initialization. The D-Bus thread runs in the thread pool
and posts replies back to the main thread via PostTaskAndReply. The
upstream test calls ThreadPoolInstance::FlushForTesting() which blocks
the main thread, preventing D-Bus reply callbacks from executing, causing
a deadlock.
Replace FlushForTesting() with content::RunAllTasksUntilIdle() which
uses FlushAsyncForTesting + RunLoop to pump the main thread message loop
while waiting for thread pool completion, avoiding the deadlock.
Resolves https://github.com/brave/brave-browser/issues/54038
* Address review: use filter file instead of #define DISABLED_
Use test/filters/browser_tests-linux.filter to disable the upstream
TimeRanges test (D-Bus deadlock is Linux-specific). Rename our fixed
test to TimeRanges_BraveFixFlush to avoid name collision.
* Address review: disable test on Linux via filter only
Remove the chromium_src test override and keep only the filter file
entry to disable AutofillCounterTest.TimeRanges on Linux.
Disable Chromium test PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed
This upstream Chromium browser test intermittently fails in Brave
builds. The test relies on Blink's IdlenessDetector firing
NetworkBecameIdle, which requires 500ms of uninterrupted renderer
thread quiet time. Brave's cosmetic filters inject a MutationObserver
and setInterval(500ms) polling on all pages, generating continuous
renderer tasks that prevent the quiet window from completing.
The upstream flake rate is 1.1% over 30 days per LUCI Analysis, and
Brave's always-on cosmetic filter scripts exacerbate the flakiness
significantly.
Resolves https://github.com/brave/brave-browser/issues/54021
This upstream Chromium test fails on Linux MSan builds. Chromium has
already disabled it on ChromeOS MSan (crbug.com/491012584). The test
has a 2.7% upstream flake rate (LUCI Analysis, 30-day lookback) due to
stale histogram samples from non-Webium renderers leaking into the
HistogramTester baseline when FetchHistogramsFromChildProcesses() is
called. Under MSan instrumentation, the kInitialWebUI feature (WebUI
toolbar) navigation hangs in Brave, causing the test to time out.
Resolves https://github.com/brave/brave-browser/issues/54030
Co-authored-by: Brian R. Bondy <netzen@gmail.com>
Disable Chromium test NormalRendererMetricsAreNotMapped on Linux MSan
This is an upstream Chromium test with a 2.9% flake rate (LUCI
Analysis, 30 days). Chromium has already disabled it on ChromeOS MSan
(crbug.com/491012584). The test asserts zero samples for the renamed
Webium histogram in a non-initial-WebUI renderer, but pending
histograms from the browser's initial WebUI startup process can leak
into the measurement under slow MSan execution.
No Brave modifications exist in chrome/browser/ui/waap/.
Resolves https://github.com/brave/brave-browser/issues/54031
This Chromium test intermittently fails on Windows ASAN due to
IPH_DiscardRing attempting to show before browser initialization
completes, producing a LOG(ERROR) that causes test failure. The error
is unrelated to the accessibility labels code under test.
Brave suppresses AddAccessibilityLabelsServiceItem entirely, so this
test exercises disabled functionality. The test is stable upstream
(0.3% flake rate per LUCI Analysis). Chromium already disables this
test suite on Linux (accessibility-linux.browser_tests.filter).
Using a Windows-ASAN-specific filter file since the failure is only
reported on that configuration.
Resolves https://github.com/brave/brave-browser/issues/54036
Disable UpToDateMetadataWithEngineMigrationDowngrade and
DifferentCountryWithEngineMigrationDowngrade test cases in
components_unittests.
These are upstream Chromium tests that fail because Brave overrides
GetDataVersion() to add kBraveCurrentDataVersion (32) to the upstream
version. The test uses raw kCurrentDataVersion for db_version, so
db_version < GetDataVersion() always triggers the version upgrade
path instead of returning nullopt.
These two test cases were missed in previous filter additions because
they have hits_dcheck=true and take the death-test path in debug
builds. In official/nightly builds (DCHECK off), they fall through
to EXPECT_EQ and fail due to the version mismatch.
Stable upstream (0% flake rate over 30 days, 302K+ verdicts).
Brave modifies components/search_engines/ via chromium_src
(template_url_prepopulate_data.cc GetDataVersion override).
Same root cause as the 7 other already-filtered tests from this suite.
Resolves https://github.com/brave/brave-browser/issues/54012
* Add Web Discovery build flag
* Remove obsolete kDontAskEnableWebDiscovery pref
This legacy pref was only being registered and immediately cleared
during migration. Remove it entirely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add extracted_text field to UploadedFile mojom
Add an optional extracted_text string field to the UploadedFile mojom
struct for holding PDF text extracted at upload time via the PDF
rendering pipeline and ScreenAI OCR.
Update all UploadedFile::New() call sites to pass std::nullopt and
all TS UploadedFile object literals to include extractedText. Add
database migration v9->v10 for the encrypted extracted_text column,
update INSERT/SELECT queries, and add v9 SQL dump for migration tests.
* Integrate PdfTextExtractor into upload pipeline
Wire PdfTextExtractor into AIChatUIHandler via a new ProcessPdfFile
mojo endpoint for WebUI drag-and-drop PDF uploads.
- Add ProcessPdfFile to AIChatUIHandler mojom interface
- Implement on desktop (creates PdfTextExtractor, returns UploadedFile
with extracted_text) and iOS (no-op, returns raw data only)
- Update UploadFileHelper UploadedFile::New call sites for new field
- Update TypeScript: file_utils.ts, input_box, drag_overlay to call
processPdfFile for PDF files with fallback to raw data
- Update API layer and mock interfaces with processPdfFile endpoint
* Send extracted PDF text in engine layer, prefer over raw bytes
When a PDF has extracted_text, send it as a TextContentBlock prefixed
with "[PDF: filename]" instead of the raw FileContentBlock. Only fall
back to raw bytes when no text was extracted. This ensures local LLMs
that cannot process raw PDF bytes still get usable content.
* Extract shared PDF text extraction helper from AssociatedWebContentsContent
Move the PDF text extraction logic (GetPdfBytes → GetPageText →
BarrierCallback → JoinString) from AssociatedWebContentsContent into
a standalone ExtractTextFromLoadedPdf() helper in pdf_text_helper.cc.
No behavioral changes — exact same logic, just in a reusable location.
* Add unit tests and zero-page guard for PDF text helper
Add unit tests for ExtractTextFromLoadedPdf() using a real
PDFDocumentHelper with a mock PdfListener: single page, multi-page
ordering, failed status, zero pages, and no-helper cases.
Also guard against page_count == 0 to avoid passing zero to
BarrierCallback.
* Add PdfTextExtractor for background PDF text extraction
Create PdfTextExtractor that loads raw PDF bytes in a hidden background
WebContents, waits for the PDF viewer + ScreenAI OCR pipeline to run,
then extracts text via the shared ExtractTextFromLoadedPdf() helper.
The extractor writes PDF bytes to a temp file, navigates a sandboxed
background WebContents to the file URL, monitors DidFinishLoad to
detect when PDFDocumentHelper is available, registers for document load
completion, then extracts text from all pages. Includes a 30-second
timeout and graceful cleanup of temp files.
ARCH-062 combined two distinct concerns under one heading, causing
the bot to demand CUJ InteractiveBrowserTest for non-UI code like
tab helpers and services. Split into:
- ARCH-062: CUJ tests required only for features with UI changes
- ARCH-062b: Avoid change detector tests (general testing guidance)
Clarify that non-UI components should use unit tests or browser tests
appropriate to the code rather than CUJ tests.
Rich media new tab takeover creatives can now trigger a one-click flow
to set Brave Search as the user's default search engine. The creative
sends a message to the new tab page which shows a confirmation dialog,
and if the user confirms, Brave Search is set as the default without the
user needing to visit settings.
Co-authored-by: Kevin Smith <zenparsing@gmail.com>
Custom push notifications rendered notification ads as popup windows as a
fallback when native OS notifications were unavailable. Native notifications
are now the only delivery path so the entire custom rendering path, its
feature flags, platform bridge, Views UI, Android dialog UI, P3A position
metric, and three migrated prefs are removed.
Co-authored-by: Aleksei Seren <aseren@brave.com>
Resolves https://github.com/brave/brave-browser/issues/54193
* When a browser window starts with horizontal tabs, BrowserFrameViewMac skips creating
fullscreen_toolbar_controller_ because UsesImmersiveFullscreenMode() returns true at construction.
If the user later switches to vertical tabs at runtime, UsesImmersiveFullscreenMode() becomes false,
but the controller remains nil.
* At that point, ObjC messaging nil for toolbarStyle returns 0, which equals TOOLBAR_PRESENT —
causing ShouldHideTopUIInFullscreen() to return false even during tab (content) fullscreen.
The toolbar stays visible when it should be hidden.
* Fix: override ShouldHideTopUIInFullscreen() in BraveBrowserFrameViewMac to explicitly return true
when vertical tabs are active and we're in content fullscreen, bypassing the broken nil-controller path.