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

Delta Between Two Patch Sets: test/abp2blocklist.js

Issue 29349981: Noissue - Remove rules which match no resource types (Closed)
Left Patch Set: Created Aug. 19, 2016, 5:33 p.m.
Right Patch Set: Remove redundant comment, use simpler test filters Created Aug. 22, 2016, 12:43 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/abp2blocklist.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 testRules(test, ["||example.com"], [ 87 testRules(test, ["||example.com"], [
88 {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com", 88 {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
89 "url-filter-is-case-sensitive": true, 89 "url-filter-is-case-sensitive": true,
90 "resource-type": ["image", "style-sheet", "script", "font", 90 "resource-type": ["image", "style-sheet", "script", "font",
91 "media", "raw", "document"]}, 91 "media", "raw", "document"]},
92 92
93 action: {type: "block"}} 93 action: {type: "block"}}
94 ]); 94 ]);
95 95
96 // Rules which would match no resource-types shouldn't be generated. 96 // Rules which would match no resource-types shouldn't be generated.
97 testRules(test, ["foo$~image,~stylesheet,~script,~font,~media,~object," + 97 testRules(test, ["foo$document", "||foo.com$document"], []);
98 "~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
99 "~subdocument", "foo$document"], []);
100 98
101 test.done(); 99 test.done();
102 }, 100 },
103 101
104 testRequestFilterExceptions: function(test) 102 testRequestFilterExceptions: function(test)
105 { 103 {
106 testRules(test, ["@@example.com"], [ 104 testRules(test, ["@@example.com"], [
107 {trigger: {"url-filter": "^https?://.*example\\.com", 105 {trigger: {"url-filter": "^https?://.*example\\.com",
108 "resource-type": ["image", "style-sheet", "script", "font", 106 "resource-type": ["image", "style-sheet", "script", "font",
109 "media", "raw", "document"]}, 107 "media", "raw", "document"]},
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 testUnicode: function(test) 226 testUnicode: function(test)
229 { 227 {
230 testRules(test, ["$domain=🐈.cat"], ["xn--zn8h.cat", "www.xn--zn8h.cat"], 228 testRules(test, ["$domain=🐈.cat"], ["xn--zn8h.cat", "www.xn--zn8h.cat"],
231 rules => rules[0]["trigger"]["if-domain"]); 229 rules => rules[0]["trigger"]["if-domain"]);
232 testRules(test, ["🐈$domain=🐈.cat"], []); 230 testRules(test, ["🐈$domain=🐈.cat"], []);
233 testRules(test, ["###🐈"], []); 231 testRules(test, ["###🐈"], []);
234 232
235 test.done(); 233 test.done();
236 } 234 }
237 }; 235 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld