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-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 removeFilter("~foo.example.com,example.com##foo"); | 173 removeFilter("~foo.example.com,example.com##foo"); |
174 | 174 |
175 // Test criteria | 175 // Test criteria |
176 addFilter("##hello"); | 176 addFilter("##hello"); |
177 addFilter("~example.com##world"); | 177 addFilter("~example.com##world"); |
178 addFilter("foo.com##specific"); | 178 addFilter("foo.com##specific"); |
179 testResult(test, "foo.com", ["specific"], true); | 179 testResult(test, "foo.com", ["specific"], true); |
180 testResult(test, "foo.com", ["hello", "specific", "world"], false); | 180 testResult(test, "foo.com", ["hello", "specific", "world"], false); |
181 testResult(test, "foo.com", ["hello", "specific", "world"]); | 181 testResult(test, "foo.com", ["hello", "specific", "world"]); |
| 182 testResult(test, "foo.com.", ["hello", "specific", "world"]); |
182 removeFilter("foo.com##specific"); | 183 removeFilter("foo.com##specific"); |
183 removeFilter("~example.com##world"); | 184 removeFilter("~example.com##world"); |
184 removeFilter("##hello"); | 185 removeFilter("##hello"); |
185 testResult(test, "foo.com", []); | 186 testResult(test, "foo.com", []); |
186 | 187 |
187 addFilter("##hello"); | 188 addFilter("##hello"); |
188 testResult(test, "foo.com", [], true); | 189 testResult(test, "foo.com", [], true); |
189 testResult(test, "foo.com", ["hello"], false); | 190 testResult(test, "foo.com", ["hello"], false); |
190 testResult(test, "foo.com", ["hello"]); | 191 testResult(test, "foo.com", ["hello"]); |
191 testResult(test, "bar.com", [], true); | 192 testResult(test, "bar.com", [], true); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 }; | 232 }; |
232 | 233 |
233 exports.testZeroFilterKey = function(test) | 234 exports.testZeroFilterKey = function(test) |
234 { | 235 { |
235 ElemHide.add(Filter.fromText("##test")); | 236 ElemHide.add(Filter.fromText("##test")); |
236 ElemHide.add(Filter.fromText("foo.com#@#test")); | 237 ElemHide.add(Filter.fromText("foo.com#@#test")); |
237 testResult(test, "foo.com", []); | 238 testResult(test, "foo.com", []); |
238 testResult(test, "bar.com", ["test"]); | 239 testResult(test, "bar.com", ["test"]); |
239 test.done(); | 240 test.done(); |
240 }; | 241 }; |
OLD | NEW |