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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 { | 467 { |
468 filter.hitCount = 0; | 468 filter.hitCount = 0; |
469 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); | 469 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); |
470 | 470 |
471 filter.delete(); | 471 filter.delete(); |
472 test.done(); | 472 test.done(); |
473 }; | 473 }; |
474 | 474 |
475 exports.testEmptyElemHideDomains = function(test) | 475 exports.testEmptyElemHideDomains = function(test) |
476 { | 476 { |
477 let emptyDomainFilters = [ | 477 [",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", |
478 ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", | 478 ",foo.com##selector", "foo.com,~##selector", |
479 ",foo.com##selector", "foo.com,~##selector", | 479 "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector"] |
480 "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector" | 480 .map(filterText => Filter.fromText(filterText)) |
481 ]; | 481 .forEach(withNAD(0, filter => |
482 | 482 { |
483 for (let filterText of emptyDomainFilters) | 483 test.ok(filter instanceof InvalidFilter); |
484 { | 484 test.equal(filter.reason, "filter_invalid_domain"); |
485 let filter = Filter.fromText(filterText); | 485 })); |
486 test.ok(filter instanceof InvalidFilter); | 486 |
487 test.equal(filter.reason, "filter_invalid_domain"); | 487 test.done(); |
488 filter.delete(); | 488 }; |
489 } | |
490 | |
491 test.done(); | |
492 }; | |
LEFT | RIGHT |