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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc

Issue 2892843003: [subresource_filter] Reland: Decide UNSUPPORTED_SCHEME only if we'd otherwise activate (Closed)
Patch Set: Created 3 years, 7 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/content/browser/content_subresource_filter_driver_factory.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/content/browser/content_subresource_filter_driver_factory_unittest.cc
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
index 48ba44860aee0d666e5121a5b11f5622a24f4feb..7459d7d1eb21e42ec2cda81868cf00f4a1674753 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
@@ -734,9 +734,17 @@ TEST_P(ContentSubresourceFilterDriverFactoryActivationScopeTest,
"https://example.test"};
for (auto* url : unsupported_urls) {
SCOPED_TRACE(url);
+ ActivationDecision expected_decision =
+ ActivationDecision::UNSUPPORTED_SCHEME;
+ // We only log UNSUPPORTED_SCHEME if the navigation would have otherwise
+ // activated. Note that non http/s URLs will never match an activation list.
+ if (test_data.expected_activation_decision ==
+ ActivationDecision::ACTIVATION_CONDITIONS_NOT_MET ||
+ test_data.activation_scope == ActivationScope::ACTIVATION_LIST) {
+ expected_decision = ActivationDecision::ACTIVATION_CONDITIONS_NOT_MET;
+ }
NavigateAndExpectActivation({test_data.url_matches_activation_list},
- {GURL(url)},
- ActivationDecision::UNSUPPORTED_SCHEME);
+ {GURL(url)}, expected_decision);
}
for (auto* url : supported_urls) {
SCOPED_TRACE(url);
« no previous file with comments | « components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698