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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 filter.hitCount++; | 427 filter.hitCount++; |
428 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); | 428 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); |
429 checkNotifications(() => | 429 checkNotifications(() => |
430 { | 430 { |
431 filter.hitCount = 0; | 431 filter.hitCount = 0; |
432 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); | 432 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); |
433 | 433 |
434 filter.delete(); | 434 filter.delete(); |
435 test.done(); | 435 test.done(); |
436 }; | 436 }; |
| 437 |
| 438 exports.testEmptyElemHideDomains = function(test) |
| 439 { |
| 440 let emptyDomainFilters = [ |
| 441 ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", |
| 442 ",foo.com##selector", "foo.com,~##selector", |
| 443 "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector" |
| 444 ]; |
| 445 |
| 446 for (let filterText of emptyDomainFilters) |
| 447 { |
| 448 let filter = Filter.fromText(filterText); |
| 449 test.ok(filter instanceof InvalidFilter); |
| 450 test.equal(filter.reason, "filter_invalid_domain"); |
| 451 filter.delete(); |
| 452 } |
| 453 |
| 454 test.done(); |
| 455 }; |
OLD | NEW |