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

Delta Between Two Patch Sets: test/abp2blocklist.js

Issue 29349989: Issue 4327 - Prevent generic document blocking (Closed)
Left Patch Set: Created Aug. 19, 2016, 5:55 p.m.
Right Patch Set: Rebased. Created Aug. 22, 2016, 4:31 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," +
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 testUnicode: function(test) 232 testUnicode: function(test)
235 { 233 {
236 testRules(test, ["$domain=🐈.cat"], ["xn--zn8h.cat", "www.xn--zn8h.cat"], 234 testRules(test, ["$domain=🐈.cat"], ["xn--zn8h.cat", "www.xn--zn8h.cat"],
237 rules => rules[0]["trigger"]["if-domain"]); 235 rules => rules[0]["trigger"]["if-domain"]);
238 testRules(test, ["🐈$domain=🐈.cat"], []); 236 testRules(test, ["🐈$domain=🐈.cat"], []);
239 testRules(test, ["###🐈"], []); 237 testRules(test, ["###🐈"], []);
240 238
241 test.done(); 239 test.done();
242 } 240 }
243 }; 241 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld