Disable BrowsingTopics by stubbing out BrowsingTopicsServiceImpl (#34969)

* Disable BrowsingTopics by stubbing out BrowsingTopicsServiceImpl

Instead of relying on the kBrowsingTopics feature flag to disable
BrowsingTopics, stub out BrowsingTopicsServiceFactory in chromium_src
so the service is never created regardless of feature flag state.

- Override BrowsingTopicsServiceFactory to always return nullptr
- Remove kBrowsingTopics feature flag override (no longer needed)
- Update test filters to cover all BrowsingTopics browser tests
- Update renderer comment to reflect new disabling approach

Resolves https://github.com/brave/brave-browser/issues/53825

* Fix copyright year and add missing deleted move operators

* Address review: use #define include pattern instead of full file replacement

Replace full chromium_src file overrides with the minimal #define +
#include pattern. Only BuildServiceInstanceForBrowserContext is
overridden to return nullptr; all other factory methods use the
upstream implementation.

* Address review: simplify to filter-only changes

Remove chromium_src overrides for BrowsingTopicsServiceFactory — the
upstream factory already returns nullptr when kBrowsingTopics is
disabled via feature flag. Only update test filter files to use
wildcard patterns for all BrowsingTopics-related tests.
This commit is contained in:
Netzenbot
2026-04-02 13:43:34 -04:00
committed by GitHub
parent bb8e455038
commit 02f453bf50
2 changed files with 6 additions and 8 deletions
+5 -7
View File
@@ -744,12 +744,10 @@
-All/BrowsingDataModelBrowserTest.TopicsAccessReportedCorrectly/*
-All/BrowsingTopicsSubresourceRequestTest.*
-AttestationBrowsingTopicsBrowserTest.*
-BrowsingTopicsBrowserTestNoTestingConfig.CalculationResultUkm
# These tests are flaky due to a race in TestAnnotator's async model info
# callback. Already disabled upstream with DISABLED_ prefix.
# https://github.com/brave/brave-browser/issues/53618
-BrowsingTopicsInternalsBrowserTest.ClassifierTab
-BrowsingTopicsInternalsBrowserTest.ClassifierTab_ModelUnavailable
-BrowsingTopicsBrowserTestNoTestingConfig.*
-BrowsingTopicsDisabledBrowserTest.*
-BrowsingTopicsDisabledInternalsBrowserTest.*
-BrowsingTopicsInternalsBrowserTest.*
-ChromeAttributionAttestationsBrowserTest.AttributionUponAttestationsLoading
-ChromeAttributionBrowserTest.AttestedSiteCanReceiveAttributionReport
-ChromeAttributionBrowserTest.SourceClicked_FeatureRecorded
@@ -2845,7 +2843,7 @@
-BrowserViewTestRefreshOnly.*
-BrowsingDataCounterUtilsBrowserTest.*
-BrowsingDataRemoverBrowserTest.*
-BrowsingTopicsAnnotationGoldenDataBrowserTest.GoldenData
-BrowsingTopicsAnnotationGoldenDataBrowserTest.*
-BrowsingTopicsBrowserTest.*
-CaptivePortalBlockingPageTest.*
-CaptivePortalBrowserTest.*
+1 -1
View File
@@ -145,7 +145,7 @@
-AttributionStorageSqlMigrationsTest.MigrateVersion56ToCurrent
-AttributionStorageSqlTest.*
-AttributionSuitableContextTest.ConversionMeasurementDisabled_NonSuitable
-BrowsingTopicsURLLoaderTest.TopicsNotEligibleDueToFromFencedFrame
-BrowsingTopicsURLLoaderTest.*
-KeepAliveAttributionRequestHelperTest.*
-LocalResourceURLLoaderFactoryCanServeTest/LocalResourceURLLoaderFactoryCanServeTest.CanServe/1
-LocalResourceURLLoaderFactoryCanServeTest/LocalResourceURLLoaderFactoryCanServeTest.CanServe/2