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

Unified Diff: components/subresource_filter/core/common/indexed_ruleset_unittest.cc

Issue 2167653002: Make the subresource filter support subdomain anchor matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more comments from engedy@ Created 4 years, 5 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: components/subresource_filter/core/common/indexed_ruleset_unittest.cc
diff --git a/components/subresource_filter/core/common/indexed_ruleset_unittest.cc b/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
index e18f52041d4f2eae936fe6ba4ba0aa1e106a5e6a..0c85e69b2a865e7ac29840a82f1848da410685ed 100644
--- a/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
+++ b/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
@@ -142,12 +142,14 @@ TEST_F(IndexedRulesetTest, OneRuleWithoutMetaInfo) {
"http://test.example.com",
false},
{{"example.com", kSubdomain, kAnchorNone},
+ "https://test.example.com.com",
+ false},
+ {{"example.com", kSubdomain, kAnchorNone},
"https://test.rest.example.com",
false},
-
- // FIXME(pkalinnikov): Implement SUBDOMAIN matching.
- // {"example.com", kSubdomain, kAnchorNone}, "https://test_example.com",
- // true},
+ {{"example.com", kSubdomain, kAnchorNone},
+ "https://test_example.com",
+ true},
{{"http://example.com", kBoundary, kAnchorNone},
"http://example.com/",
@@ -219,10 +221,9 @@ TEST_F(IndexedRulesetTest, OneRuleWithoutMetaInfo) {
{{"test.example.com^", kSubdomain, kAnchorNone},
"http://test.example.com.ua/42.swf",
true},
-
- // FIXME(pkalinnikov): Implement SUBDOMAIN matching.
- // {"test.example.com^", kSubdomain, kAnchorNone},
- // "http://example.com/redirect/http://test.example.com/", true},
+ {{"test.example.com^", kSubdomain, kAnchorNone},
+ "http://example.com/redirect/http://test.example.com/",
+ true},
{{"/abcd/*"}, "https://example.com/abcd/", false},
{{"/abcd/*"}, "http://example.com/abcd/picture.jpeg", false},

Powered by Google App Engine
This is Rietveld 408576698