Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/matcher.js

Issue 30018560: Issue 7312 - Ignore lone pure generic filters for specific-only queries (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Add more tests Created Feb. 26, 2019, noon
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/matcher.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/matcher.js
===================================================================
--- a/test/matcher.js
+++ b/test/matcher.js
@@ -240,16 +240,23 @@
checkMatch(test, ["/bar", "@@||foo.com^"], "http://foo.com/foo", "IMAGE", "foo.com", false, null, false, null, "@@||foo.com^");
checkMatch(test, ["||foo.com^$popup"], "http://foo.com/bar", "POPUP", "foo.com", false, null, false, "||foo.com^$popup");
checkMatch(test, ["@@||foo.com^$popup"], "http://foo.com/bar", "POPUP", "foo.com", false, null, false, null, "@@||foo.com^$popup");
checkMatch(test, ["||foo.com^$popup", "@@||foo.com^$popup"], "http://foo.com/bar", "POPUP", "foo.com", false, null, false, "@@||foo.com^$popup", "||foo.com^$popup");
checkMatch(test, ["||foo.com^$csp=script-src 'none'"], "http://foo.com/bar", "CSP", "foo.com", false, null, false, "||foo.com^$csp=script-src 'none'");
checkMatch(test, ["@@||foo.com^$csp"], "http://foo.com/bar", "CSP", "foo.com", false, null, false, null, "@@||foo.com^$csp");
checkMatch(test, ["||foo.com^$csp=script-src 'none'", "@@||foo.com^$csp"], "http://foo.com/bar", "CSP", "foo.com", false, null, false, "@@||foo.com^$csp", "||foo.com^$csp=script-src 'none'");
+ // See #7312.
+ checkMatch(test, ["^foo/bar/$script"], "http://foo/bar/", "SCRIPT", "example.com", true, null, true, null);
+ checkMatch(test, ["^foo/bar/$script"], "http://foo/bar/", "SCRIPT", "example.com", true, null, false, "^foo/bar/$script");
+ checkMatch(test, ["^foo/bar/$script,domain=example.com", "@@^foo/bar/$script"], "http://foo/bar/", "SCRIPT", "example.com", true, null, true, "@@^foo/bar/$script", "^foo/bar/$script,domain=example.com");
+ checkMatch(test, ["@@^foo/bar/$script", "^foo/bar/$script,domain=example.com"], "http://foo/bar/", "SCRIPT", "example.com", true, null, true, "@@^foo/bar/$script", "^foo/bar/$script,domain=example.com");
+ checkMatch(test, ["@@^foo/bar/$script", "^foo/bar/$script,domain=example.com"], "http://foo/bar/", "SCRIPT", "example.com", true, null, false, "@@^foo/bar/$script");
+
test.done();
};
exports.testFilterSearch = function(test)
{
// Start with three filters: foo, bar, and @@foo
let filters = ["foo", "bar", "@@foo"];
« no previous file with comments | « lib/matcher.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld