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 Created Dec. 5, 2017, 6:06 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
@@ -452,8 +452,27 @@
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)
+ {
+ let filter = Filter.fromText(filterText);
+ test.ok(filter instanceof InvalidFilter);
+ test.equal(filter.reason, "filter_invalid_domain");
+ filter.delete();
+ }
+
+ 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