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

Unified Diff: test/abp2blocklist.js

Issue 29457578: Issue 4327 - Do not apply $subdocument filters to top-level documents (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 6, 2017, 12:50 p.m.
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/abp2blocklist.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/abp2blocklist.js
===================================================================
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -82,34 +82,40 @@
test.done();
},
testRequestFilters: function(test)
{
testRules(test, ["/foo", "||test.com", "http://example.com/foo"], [
{trigger: {"url-filter": "^https?://.*/foo",
"resource-type": ["image", "style-sheet", "script", "font",
- "media", "raw", "document"]},
+ "media", "raw", "document"],
+ "unless-top-url": ["^https?://.*/foo"]},
action: {type: "block"}},
{trigger: {"url-filter": "^https?://([^/]+\\.)?test\\.com",
"url-filter-is-case-sensitive": true,
"resource-type": ["image", "style-sheet", "script", "font",
- "media", "raw", "document"]},
+ "media", "raw", "document"],
+ "unless-top-url": ["^https?://([^/]+\\.)?test\\.com"],
+ "top-url-filter-is-case-sensitive": true},
action: {type: "block"}},
{trigger: {"url-filter": "http://example\\.com/foo",
"resource-type": ["image", "style-sheet", "script", "font",
- "media", "raw", "document"]},
+ "media", "raw", "document"],
+ "unless-top-url": ["http://example\\.com/foo"]},
action: {type: "block"}}
]);
testRules(test, ["||example.com"], [
{trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
"url-filter-is-case-sensitive": true,
"resource-type": ["image", "style-sheet", "script", "font",
- "media", "raw", "document"]},
+ "media", "raw", "document"],
+ "unless-top-url": ["^https?://([^/]+\\.)?example\\.com"],
+ "top-url-filter-is-case-sensitive": true},
action: {type: "block"}}
]);
// Rules which would match no resource-types shouldn't be generated.
testRules(test, ["foo$document", "||foo.com$document"], []);
test.done();
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld