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

Unified Diff: test/abp2blocklist.js

Issue 29467585: Issue 4327 - Prevent filters with no hostname from blocking documents (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Add comments Created July 8, 2017, 11:28 a.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,18 +82,17 @@
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"],
- "unless-top-url": ["^https?://.*/foo"]},
+ "media", "raw"]},
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"],
"unless-top-url": ["^https?://([^/]+\\.)?test\\.com"],
"top-url-filter-is-case-sensitive": true},
action: {type: "block"}},
@@ -217,32 +216,31 @@
testRequestTypeMapping: function(test)
{
testRules(
test,
["1", "2$image", "3$stylesheet", "4$script", "5$font", "6$media",
"7$popup", "8$object", "9$object_subrequest", "10$xmlhttprequest",
"11$ping", "12$subdocument", "13$other", "14$IMAGE",
"15$script,PING,Popup", "16$~image"],
- [["image", "style-sheet", "script", "font", "media", "raw", "document" ],
+ [["image", "style-sheet", "script", "font", "media", "raw"],
["image"],
["style-sheet"],
["script"],
["font"],
["media"],
["popup"],
["media"],
["raw"],
["raw"],
["raw"],
- ["document"],
["raw"],
["image"],
["script", "popup", "raw" ],
- ["style-sheet", "script", "font", "media", "raw", "document"]],
+ ["style-sheet", "script", "font", "media", "raw"]],
rules => rules.map(rule => rule.trigger["resource-type"])
);
test.done();
},
testUnsupportedfilters: function(test)
{
« 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