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: Make the new test more functional Created March 6, 2018, 7:47 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,23 @@
checkNotifications(() =>
{
filter.hitCount = 0;
}, ["filter.hitCount", "foobar"], "Resetting filter hit counts");
filter.delete();
test.done();
};
+
+exports.testEmptyElemHideDomains = function(test)
+{
+ [",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector",
+ ",foo.com##selector", "foo.com,~##selector",
+ "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector"]
+ .map(filterText => Filter.fromText(filterText))
+ .forEach(withNAD(0, filter =>
+ {
+ test.ok(filter instanceof InvalidFilter);
+ test.equal(filter.reason, "filter_invalid_domain");
+ }));
+
+ 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