Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: chrome/browser/subresource_filter/subresource_filter_browsertest.cc

Issue 2798983002: Introduce subresource_filter::Configuration. (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/subresource_filter/subresource_filter_browsertest.cc
diff --git a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
index b74fbc3f5113ad1509fb90d9fb3ec75c072952ad..09f1e4aad90c9da78d6f8d0e9717c0649d805305 100644
--- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -260,7 +260,7 @@ class SubresourceFilterBrowserTestImpl : public InProcessBrowserTest {
}
virtual void SetUpActivationFeature() {
- scoped_feature_toggle_.reset(new ScopedSubresourceFilterFeatureToggle(
+ ToggleFeatures(base::MakeUnique<ScopedSubresourceFilterFeatureToggle>(
base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled,
kActivationScopeActivationList, kActivationListPhishingInterstitial,
measure_performance_ ? "1" : "0", "" /* suppress_notifications */,
@@ -362,8 +362,12 @@ class SubresourceFilterBrowserTestImpl : public InProcessBrowserTest {
test_ruleset_publisher_.SetRuleset(test_ruleset_pair.unindexed));
}
- void set_scoped_feature_toggle(ScopedSubresourceFilterFeatureToggle* toggle) {
- scoped_feature_toggle_.reset(toggle);
+ void ToggleFeatures(
+ std::unique_ptr<ScopedSubresourceFilterFeatureToggle> features) {
+ scoped_feature_toggle_ = std::move(features);
+ ContentSubresourceFilterDriverFactory* driver_factory =
+ ContentSubresourceFilterDriverFactory::FromWebContents(web_contents());
+ driver_factory->set_configuration_for_testing(GetActiveConfiguration());
}
private:
@@ -459,7 +463,7 @@ class SubresourceFilterListBrowserTest
: SubresourceFilterBrowserTestImpl(false, false) {}
void SetUpActivationFeature() override {
- set_scoped_feature_toggle(new ScopedSubresourceFilterFeatureToggle(
+ ToggleFeatures(base::MakeUnique<ScopedSubresourceFilterFeatureToggle>(
base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled,
kActivationScopeActivationList, kActivationListSubresourceFilter, "0",
"" /* suppress_notifications */, "false"));

Powered by Google App Engine
This is Rietveld 408576698