OLD | NEW |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 "use strict"; | 18 "use strict"; |
19 | 19 |
20 GLOBAL.Ci = {}; | |
21 GLOBAL.Cu = { | |
22 import: function() | |
23 { | |
24 } | |
25 }; | |
26 | |
27 let {ElemHide} = require("elemHide"); | 20 let {ElemHide} = require("elemHide"); |
28 let {Filter} = require("filterClasses"); | 21 let {Filter} = require("filterClasses"); |
29 | 22 |
30 exports.testGetSelectorsForDomain = function(test) | 23 exports.testGetSelectorsForDomain = function(test) |
31 { | 24 { |
32 let addFilter = filterText => ElemHide.add(Filter.fromText(filterText)); | 25 let addFilter = filterText => ElemHide.add(Filter.fromText(filterText)); |
33 let removeFilter = filterText => ElemHide.remove(Filter.fromText(filterText)); | 26 let removeFilter = filterText => ElemHide.remove(Filter.fromText(filterText)); |
34 | 27 |
35 function normalizeSelectors(selectors) | 28 function normalizeSelectors(selectors) |
36 { | 29 { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 149 |
157 addFilter("~example.com##foo"); | 150 addFilter("~example.com##foo"); |
158 selectorsEqual("foo.example.com", []); | 151 selectorsEqual("foo.example.com", []); |
159 selectorsEqual("example.com", ["foo"]); | 152 selectorsEqual("example.com", ["foo"]); |
160 selectorsEqual("com", ["foo"]); | 153 selectorsEqual("com", ["foo"]); |
161 selectorsEqual("", ["foo"]); | 154 selectorsEqual("", ["foo"]); |
162 removeFilter("example.org##foo"); | 155 removeFilter("example.org##foo"); |
163 | 156 |
164 test.done(); | 157 test.done(); |
165 }; | 158 }; |
OLD | NEW |