LEFT | RIGHT |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 action: {type: "css-display-none", selector: ".whatever"}} | 58 action: {type: "css-display-none", selector: ".whatever"}} |
59 ]) | 59 ]) |
60 ]); | 60 ]); |
61 }, | 61 }, |
62 | 62 |
63 testElementHidingExceptions: function(test) | 63 testElementHidingExceptions: function(test) |
64 { | 64 { |
65 runTest(test, [ | 65 runTest(test, [ |
66 testRules(test, [ | 66 testRules(test, [ |
67 "##.whatever", | 67 "##.whatever", |
68 "test.com###something", | 68 "test.com,anothertest.com###something", |
69 "@@||special.test.com^$elemhide", | 69 "@@||special.test.com^$elemhide", |
70 "@@||test.com^$generichide", | 70 "@@||test.com^$generichide", |
| 71 "@@||anothertest.com^$elemhide", |
71 "@@^something^$elemhide", | 72 "@@^something^$elemhide", |
72 "@@^anything^$generichide" | 73 "@@^anything^$generichide" |
73 ], [ | 74 ], [ |
74 ["^https?://", ["*test.com", "*special.test.com"]], | 75 ["^https?://", ["*test.com", "*special.test.com", "*anothertest.com"]], |
75 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]] | 76 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]] |
76 ], rules => rules.map(rule => [rule.trigger["url-filter"], | 77 ], rules => rules.map(rule => [rule.trigger["url-filter"], |
77 rule.trigger["unless-domain"]])), | 78 rule.trigger["unless-domain"]])), |
78 | 79 |
79 testRules(test, ["#@#whatever"], []), | 80 testRules(test, ["#@#whatever"], []), |
80 testRules(test, ["test.com#@#whatever"], []), | 81 testRules(test, ["test.com#@#whatever"], []), |
81 testRules(test, ["~test.com#@#whatever"], []), | 82 testRules(test, ["~test.com#@#whatever"], []), |
82 | 83 |
83 // We currently completely ignore any element hiding filters that have the | 84 // We currently completely ignore any element hiding filters that have the |
84 // same selector as an element hiding exception. In these examples | 85 // same selector as an element hiding exception. In these examples |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 {merge: "all"}), | 498 {merge: "all"}), |
498 | 499 |
499 // Redundant rules should be discarded. | 500 // Redundant rules should be discarded. |
500 testRules(test, ["/ad", "/ads", "/advertisement"], | 501 testRules(test, ["/ad", "/ads", "/advertisement"], |
501 ["^[^:]+:(//)?.*/ad"], | 502 ["^[^:]+:(//)?.*/ad"], |
502 rules => rules.map(rule => rule.trigger["url-filter"]), | 503 rules => rules.map(rule => rule.trigger["url-filter"]), |
503 {merge: "all"}) | 504 {merge: "all"}) |
504 ]); | 505 ]); |
505 } | 506 } |
506 }; | 507 }; |
LEFT | RIGHT |