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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/filter/RegExpFilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
===================================================================
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -466,8 +466,28 @@
checkNotifications(() =>
{
filter.hitCount = 0;
}, ["filter.hitCount", "foobar"], "Resetting filter hit counts");
filter.delete();
test.done();
};
+
+exports.testEmptyElemHideDomains = function(test)
+{
+ let emptyDomainFilters = [
+ ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector",
+ ",foo.com##selector", "foo.com,~##selector",
+ "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector"
+ ];
+
+ for (let filterText of emptyDomainFilters)
+ {
+ withNAD(0, filter =>
+ {
+ test.ok(filter instanceof InvalidFilter);
+ test.equal(filter.reason, "filter_invalid_domain");
+ })(Filter.fromText(filterText));
+ }
+
+ test.done();
+};
« 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