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

Unified Diff: test/filterClasses.js

Issue 29356018: Issue 4450 - Prevent ElemHide filters with empty domains (Closed)
Patch Set: Addressed feedback Created Oct. 6, 2016, 8:50 a.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 | « test/elemHide.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
diff --git a/test/filterClasses.js b/test/filterClasses.js
index 7bb75fc4642226ae0cf5175f0c896b45d1973924..905883b4fa4a69df2eedd1063ab2345feee9e125 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -366,3 +366,21 @@ exports.testCSSPropertyFilters = function(test)
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");
+ }
+
+ test.done();
+};
« no previous file with comments | « test/elemHide.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld