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

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

Issue 2175763002: Integrate IndexedRuleset into DocumentSubresourceFilter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. 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 0c85e69b2a865e7ac29840a82f1848da410685ed..4dd8079b53362512c2775967e55772c1d01f3a00 100644
--- a/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
+++ b/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
@@ -41,7 +41,7 @@ class IndexedRulesetTest : public testing::Test {
bool ShouldAllow(
const char* url,
const char* initiator = nullptr,
- proto::ElementType element_type = proto::ELEMENT_TYPE_UNSPECIFIED) const {
+ proto::ElementType element_type = proto::ELEMENT_TYPE_OTHER) const {
DCHECK_NE(matcher_.get(), nullptr);
url::Origin origin = GetOrigin(initiator);
return matcher_->IsAllowed(GURL(url), origin, element_type);
@@ -450,6 +450,9 @@ TEST_F(IndexedRulesetTest, OneRuleWithElementTypes) {
{"ex.com", kAll & ~kFont & ~kScript, "http://ex.com/img", kImage, false},
{"ex.com$subdocument,~subdocument", kSubdoc & ~kSubdoc,
"http://ex.com/sub", kSubdoc, true},
+
+ {"ex.com", kAll, "http://ex.com", proto::ELEMENT_TYPE_OTHER, false},
+ {"ex.com", kAll, "http://ex.com", proto::ELEMENT_TYPE_UNSPECIFIED, true},
};
for (const auto& test_case : kTestCases) {

Powered by Google App Engine
This is Rietveld 408576698