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

Unified Diff: test/abp2blocklist.js

Issue 29349981: Noissue - Remove rules which match no resource types (Closed)
Patch Set: Created Aug. 19, 2016, 5:33 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
« lib/abp2blocklist.js ('K') | « 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 fbc4f7d752cae60a9c520c1ff2b886a5b25ebd2a..8f5aa5bca7fd6fa8de14d281622cc21b74230869 100644
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -93,6 +93,10 @@ exports.generateRules = {
action: {type: "block"}}
]);
+ // Rules which would match no resource-types shouldn't be generated.
+ testRules(test, ["foo$~image,~stylesheet,~script,~font,~media,~object," +
+ "~xmlhttprequest,~object_subrequest,~ping,~other," +
Sebastian Noack 2016/08/20 13:42:50 It's document as $object-subrequest, with dash, no
kzar 2016/08/22 12:44:36 Good point, but since it's kind of a stupid test I
+ "~subdocument", "foo$document"], []);
test.done();
},
@@ -176,8 +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$document",
- "16$script,PING,Popup", "17$~image"],
+ "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"],
@@ -192,7 +196,6 @@ exports.generateRules = {
["document"],
["raw"],
["image"],
- [],
["script", "popup", "raw" ],
["style-sheet", "script", "font", "media", "raw", "document"]],
rules => rules.map(rule => rule.trigger["resource-type"])
« lib/abp2blocklist.js ('K') | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld