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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 test.ok(!matcher.isWhitelisted("https://example.com/foo", | 285 test.ok(!matcher.isWhitelisted("https://example.com/foo", |
286 RegExpFilter.typeMap.IMAGE)); | 286 RegExpFilter.typeMap.IMAGE)); |
287 test.ok(!matcher.isWhitelisted("https://example.com/bar", | 287 test.ok(!matcher.isWhitelisted("https://example.com/bar", |
288 RegExpFilter.typeMap.IMAGE)); | 288 RegExpFilter.typeMap.IMAGE)); |
289 test.ok(!matcher.isWhitelisted("https://example.com/foo", | 289 test.ok(!matcher.isWhitelisted("https://example.com/foo", |
290 RegExpFilter.typeMap.SUBDOCUMENT)); | 290 RegExpFilter.typeMap.SUBDOCUMENT)); |
291 | 291 |
292 test.done(); | 292 test.done(); |
293 }; | 293 }; |
| 294 |
| 295 exports.testAddRemove = function(test) |
| 296 { |
| 297 let matcher = new CombinedMatcher(); |
| 298 |
| 299 matcher.add(Filter.fromText("||example.com/foo/bar/image.jpg")); |
| 300 |
| 301 test.ok(!!matcher.matchesAny("https://example.com/foo/bar/image.jpg", |
| 302 RegExpFilter.typeMap.IMAGE)); |
| 303 |
| 304 matcher.remove(Filter.fromText("||example.com/foo/bar/image.jpg")); |
| 305 |
| 306 test.ok(!matcher.matchesAny("https://example.com/foo/bar/image.jpg", |
| 307 RegExpFilter.typeMap.IMAGE)); |
| 308 |
| 309 test.done(); |
| 310 }; |
OLD | NEW |