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

Side by Side Diff: test/abp2blocklist.js

Issue 29493605: Noissue - Eliminate CSS rules for whitelisted domains (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created July 20, 2017, 3:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 action: {type: "css-display-none", selector: ".whatever"}} 47 action: {type: "css-display-none", selector: ".whatever"}}
48 ]); 48 ]);
49 49
50 test.done(); 50 test.done();
51 }, 51 },
52 52
53 testElementHidingExceptions: function(test) 53 testElementHidingExceptions: function(test)
54 { 54 {
55 testRules(test, [ 55 testRules(test, [
56 "##.whatever", 56 "##.whatever",
57 "test.com###something", 57 "test.com,anothertest.com###something",
58 "@@||special.test.com^$elemhide", 58 "@@||special.test.com^$elemhide",
59 "@@||test.com^$generichide", 59 "@@||test.com^$generichide",
60 "@@||anothertest.com^$elemhide",
60 "@@^something^$elemhide", 61 "@@^something^$elemhide",
61 "@@^anything^$generichide" 62 "@@^anything^$generichide"
62 ], [ 63 ], [
63 ["^https?://", ["*test.com", "*special.test.com"]], 64 ["^https?://", ["*test.com", "*special.test.com", "*anothertest.com"]],
64 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]] 65 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]]
65 ], rules => rules.map(rule => [rule.trigger["url-filter"], 66 ], rules => rules.map(rule => [rule.trigger["url-filter"],
66 rule.trigger["unless-domain"]])); 67 rule.trigger["unless-domain"]]));
67 68
68 testRules(test, ["#@#whatever"], []); 69 testRules(test, ["#@#whatever"], []);
69 testRules(test, ["test.com#@#whatever"], []); 70 testRules(test, ["test.com#@#whatever"], []);
70 testRules(test, ["~test.com#@#whatever"], []); 71 testRules(test, ["~test.com#@#whatever"], []);
71 72
72 // We currently completely ignore any element hiding filters that have the 73 // We currently completely ignore any element hiding filters that have the
73 // same selector as an element hiding exception. In these examples #whatever 74 // same selector as an element hiding exception. In these examples #whatever
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 testRules(test, ["foo$webrtc"], [ 355 testRules(test, ["foo$webrtc"], [
355 {trigger: {"url-filter": "^stuns?:.*foo", "resource-type": ["raw"]}, 356 {trigger: {"url-filter": "^stuns?:.*foo", "resource-type": ["raw"]},
356 action: {type: "block"}}, 357 action: {type: "block"}},
357 {trigger: {"url-filter": "^turns?:.*foo", "resource-type": ["raw"]}, 358 {trigger: {"url-filter": "^turns?:.*foo", "resource-type": ["raw"]},
358 action: {type: "block"}} 359 action: {type: "block"}}
359 ]); 360 ]);
360 361
361 test.done(); 362 test.done();
362 } 363 }
363 }; 364 };
OLDNEW
« 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