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

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

Issue 2798983002: Introduce subresource_filter::Configuration. (Closed)
Patch Set: Address comments from csharrison@. 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 974cae9a8d4f2770fce5a58c79d4ce31412616b1..f1e347e7dedccb2b5eac870b8615e7def2ea14ec 100644
--- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -261,7 +261,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 */,
@@ -363,8 +363,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:
@@ -460,7 +464,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