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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 { | 172 { |
173 function checkConvertedFilter(old, converted) | 173 function checkConvertedFilter(old, converted) |
174 { | 174 { |
175 withNAD( | 175 withNAD( |
176 0, filter => test.equal(filter.text, converted))(Filter.fromText(old)); | 176 0, filter => test.equal(filter.text, converted))(Filter.fromText(old)); |
177 } | 177 } |
178 | 178 |
179 checkConvertedFilter("example.com##foo[-abp-properties='something']bar", "exam
ple.com#?#foo:-abp-properties(something)bar"); | 179 checkConvertedFilter("example.com##foo[-abp-properties='something']bar", "exam
ple.com#?#foo:-abp-properties(something)bar"); |
180 checkConvertedFilter("example.com#@#foo[-abp-properties='something']bar", "exa
mple.com#@#foo:-abp-properties(something)bar"); | 180 checkConvertedFilter("example.com#@#foo[-abp-properties='something']bar", "exa
mple.com#@#foo:-abp-properties(something)bar"); |
181 checkConvertedFilter("example.com##[-abp-properties=\"something\"]", "example.
com#?#:-abp-properties(something)"); | 181 checkConvertedFilter("example.com##[-abp-properties=\"something\"]", "example.
com#?#:-abp-properties(something)"); |
182 checkConvertedFilter("example.com##[-abp-properties=(something)]", "example.co
m#?#:-abp-properties((something))"); | 182 checkConvertedFilter("example.com##[-abp-properties='(something)']", "example.
com#?#:-abp-properties((something))"); |
183 | 183 |
184 test.done(); | 184 test.done(); |
185 }; | 185 }; |
186 | 186 |
187 exports.testDomainRestrictions = function(test) | 187 exports.testDomainRestrictions = function(test) |
188 { | 188 { |
189 function testSelectorMatches(description, filters, domain, expectedMatches) | 189 function testSelectorMatches(description, filters, domain, expectedMatches) |
190 { | 190 { |
191 withNAD([0, 1], (elemHide, elemHideEmulation) => | 191 withNAD([0, 1], (elemHide, elemHideEmulation) => |
192 { | 192 { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 "www.example.com", | 306 "www.example.com", |
307 [] | 307 [] |
308 ); | 308 ); |
309 })(Filter.fromText("example.com##filter1"), | 309 })(Filter.fromText("example.com##filter1"), |
310 Filter.fromText("www.example.com##filter2"), | 310 Filter.fromText("www.example.com##filter2"), |
311 Filter.fromText("other.example.com##filter3")); | 311 Filter.fromText("other.example.com##filter3")); |
312 })(ElemHide.create(), ElemHideEmulation.create()); | 312 })(ElemHide.create(), ElemHideEmulation.create()); |
313 | 313 |
314 test.done(); | 314 test.done(); |
315 }; | 315 }; |
LEFT | RIGHT |