Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -62,17 +62,17 @@ |
["#@#asdf", ElemHideException, "elemhideexception"], |
["foobar##asdf", ElemHideFilter, "elemhide"], |
["foobar#@#asdf", ElemHideException, "elemhideexception"], |
["foobar##a", ElemHideFilter, "elemhide"], |
["foobar#@#a", ElemHideException, "elemhideexception"], |
["foobar#asdf", BlockingFilter, "blocking"], |
["foobar|foobas##asdf", BlockingFilter, "blocking"], |
- ["foobar##asdf{asdf}", BlockingFilter, "blocking"], |
+ ["foobar##asdf{asdf}", ElemHideFilter, "elemhide"], |
["foobar##", BlockingFilter, "blocking"], |
["foobar#@#", BlockingFilter, "blocking"], |
["asdf$foobar", InvalidFilter, "invalid"], |
["asdf$image,foobar", InvalidFilter, "invalid"], |
["asdf$image=foobar", BlockingFilter, "blocking"], |
["asdf$image=foobar=xyz,~collapse", BlockingFilter, "blocking"], |
["##foo[-abp-properties='something']bar", InvalidFilter, "invalid"], |
@@ -346,17 +346,16 @@ |
}; |
exports.testElemHideSelector = function(test) |
{ |
function doTest(text, selector, selectorDomain) |
{ |
let filter = Filter.fromText(text); |
test.equal(filter.selector, selector, "Correct selector for " + text); |
- |
let actualDomains = filter.selectorDomain.split(",").sort().join(","); |
let expectedDomains = selectorDomain.split(",").sort().join(","); |
test.equal(actualDomains, expectedDomains, "Correct domains list for " + text); |
filter.delete(); |
} |
let tests = [ |
@@ -376,16 +375,26 @@ |
{ |
doTest(text, selector, selectorDomain); |
doTest(text.replace("##", "#@#"), selector, selectorDomain); |
} |
test.done(); |
}; |
+exports.testElemHideRulesWithBraces = function(test) |
+{ |
+ let filter = Filter.fromText("###foo{color: red}"); |
+ test.equal(filter.type, "elemhide"); |
+ test.equal(filter.selector, "#foo\\x7B color: red\\x7D "); |
+ filter.delete(); |
+ |
+ test.done(); |
+}; |
+ |
exports.testNotifications = function(test) |
{ |
function checkNotifications(action, expected, message) |
{ |
let result = null; |
let listener = (topic, filter) => |
{ |
if (result) |