Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/filterClasses.js

Issue 29600641: Issue 5175 - Reject element hiding filter with empty domain names (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebased patch. Created March 6, 2018, 7:32 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/filter/RegExpFilter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 filter.hitCount++; 464 filter.hitCount++;
465 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); 465 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts");
466 checkNotifications(() => 466 checkNotifications(() =>
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
475 exports.testEmptyElemHideDomains = function(test)
476 {
477 let emptyDomainFilters = [
478 ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector",
479 ",foo.com##selector", "foo.com,~##selector",
480 "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector"
481 ];
482
483 for (let filterText of emptyDomainFilters)
484 {
485 withNAD(0, filter =>
486 {
487 test.ok(filter instanceof InvalidFilter);
488 test.equal(filter.reason, "filter_invalid_domain");
489 })(Filter.fromText(filterText));
490 }
491
492 test.done();
493 };
OLDNEW
« no previous file with comments | « compiled/filter/RegExpFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld