Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -429,8 +429,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(); |
+}; |