| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 filter.hitCount++; | 450 filter.hitCount++; |
| 451 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); | 451 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); |
| 452 checkNotifications(() => | 452 checkNotifications(() => |
| 453 { | 453 { |
| 454 filter.hitCount = 0; | 454 filter.hitCount = 0; |
| 455 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); | 455 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); |
| 456 | 456 |
| 457 filter.delete(); | 457 filter.delete(); |
| 458 test.done(); | 458 test.done(); |
| 459 }; | 459 }; |
| 460 |
| 461 exports.testEmptyElemHideDomains = function(test) |
| 462 { |
| 463 let emptyDomainFilters = [ |
| 464 ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", |
| 465 ",foo.com##selector", "foo.com,~##selector", |
| 466 "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector" |
| 467 ]; |
| 468 |
| 469 for (let filterText of emptyDomainFilters) |
| 470 { |
| 471 let filter = Filter.fromText(filterText); |
| 472 test.ok(filter instanceof InvalidFilter); |
| 473 test.equal(filter.reason, "filter_invalid_domain"); |
| 474 filter.delete(); |
| 475 } |
| 476 |
| 477 test.done(); |
| 478 }; |
| OLD | NEW |