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"], |
@@ -376,16 +376,31 @@ |
{ |
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\\7B color: red\\7D "); |
+ filter.delete(); |
+ |
+ filter = Filter.fromText("foo.com##[-abp-properties='/margin: [3-4]{2}/']"); |
+ test.equal(filter.type, "elemhideemulation"); |
+ test.equal(filter.selector, "[-abp-properties='/margin: [3-4]\\7B 2\\7D /']"); |
+ filter.delete(); |
+ |
+ test.done(); |
+}; |
+ |
exports.testNotifications = function(test) |
{ |
function checkNotifications(action, expected, message) |
{ |
let result = null; |
let listener = (topic, filter) => |
{ |
if (result) |