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: Created Oct. 5, 2016, 2:24 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
« lib/filterClasses.js ('K') | « 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..54fdc00afecd8deeddff0530b41d4fd3affda928 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -366,3 +366,20 @@ 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"
Wladimir Palant 2016/10/06 08:06:14 What about empty domains in the middle? foo.com,,b
kzar 2016/10/06 08:53:56 Done.
+ ];
+
+ for (let filterText of emptyDomainFilters)
+ {
+ let filter = Filter.fromText(filterText);
+ test.ok(filter instanceof InvalidFilter);
+ test.equal(filter.reason, "filter_empty_domain");
+ }
+
+ test.done();
+};
« lib/filterClasses.js ('K') | « test/elemHide.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld