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

Unified Diff: components/subresource_filter/core/browser/subresource_filter_features_unittest.cc

Issue 2667303003: Disable subresource filtering on page reloads. (Closed)
Patch Set: move ui/base to public_deps Created 3 years, 10 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
« no previous file with comments | « components/subresource_filter/core/browser/subresource_filter_features_test_support.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/subresource_filter/core/browser/subresource_filter_features_unittest.cc
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc b/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc
index 55fb1981fd8e4c302827578f16c7527fc581c014..1918d8c6669e54cbb5ffc084a5a0325c0bb4191c 100644
--- a/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc
+++ b/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc
@@ -252,4 +252,37 @@ TEST(SubresourceFilterFeaturesTest, SuppressNotifications) {
}
}
+TEST(SubresourceFilterFeaturesTest, WhitelistSiteOnReload) {
+ const struct {
+ bool feature_enabled;
+ const char* whitelist_site_on_reload_param;
+ bool expected_whitelist_site_on_reload_value;
+ } kTestCases[] = {{false, "", false},
+ {false, "true", false},
+ {false, "false", false},
+ {false, "invalid value", false},
+ {true, "", false},
+ {true, "false", false},
+ {true, "invalid value", false},
+ {true, "True", false},
+ {true, "TRUE", false},
+ {true, "true", true}};
+
+ for (const auto& test_case : kTestCases) {
+ SCOPED_TRACE(::testing::Message("Enabled = ") << test_case.feature_enabled);
+ SCOPED_TRACE(::testing::Message("WhitelistSiteOnReloadParam = \"")
+ << test_case.whitelist_site_on_reload_param << "\"");
+
+ base::FieldTrialList field_trial_list(nullptr /* entropy_provider */);
+ testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle(
+ test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE
+ : base::FeatureList::OVERRIDE_USE_DEFAULT,
+ {{kWhitelistSiteOnReloadParameterName,
+ test_case.whitelist_site_on_reload_param}});
+
+ EXPECT_EQ(test_case.expected_whitelist_site_on_reload_value,
+ ShouldWhitelistSiteOnReload());
+ }
+}
+
} // namespace subresource_filter
« no previous file with comments | « components/subresource_filter/core/browser/subresource_filter_features_test_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698