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

Unified Diff: test/abp2blocklist.js

Issue 29349989: Issue 4327 - Prevent generic document blocking (Closed)
Patch Set: Created Aug. 19, 2016, 5:55 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
diff --git a/test/abp2blocklist.js b/test/abp2blocklist.js
index 8f5aa5bca7fd6fa8de14d281622cc21b74230869..de5daea2d6b056b0e27714ae771c37fc41d5e1df 100644
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -71,7 +71,7 @@ exports.generateRules = {
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"]},
action: {type: "block"}},
{trigger: {"url-filter": "^https?://([^/]+\\.)?test\\.com",
"url-filter-is-case-sensitive": true,
@@ -180,9 +180,8 @@ exports.generateRules = {
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" ],
+ "11$ping", "12$other", "13$IMAGE", "14$script,PING,Popup", "15$~image"],
+ [["image", "style-sheet", "script", "font", "media", "raw"],
["image"],
["style-sheet"],
["script"],
@@ -193,10 +192,17 @@ exports.generateRules = {
["raw"],
["raw"],
["raw"],
- ["document"],
["raw"],
["image"],
["script", "popup", "raw" ],
+ ["style-sheet", "script", "font", "media", "raw"]],
+ rules => rules.map(rule => rule.trigger["resource-type"])
+ );
+
+ testRules(
+ test,
+ ["foo$subdocument", "||foo.com$subdocument", "||foo.com$~image"],
+ [["document"],
["style-sheet", "script", "font", "media", "raw", "document"]],
rules => rules.map(rule => rule.trigger["resource-type"])
);
« 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