Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -374,8 +374,37 @@ |
{ |
let filter = Filter.fromText(filterText); |
test.ok(filter instanceof InvalidFilter); |
test.equal(filter.reason, "filter_invalid_domain"); |
} |
test.done(); |
}; |
+ |
+exports.testCssRuleInjection = function(test) |
+{ |
+ compareFilter(test, "###foo{color: red}", |
+ ["type=filterlist", |
+ "text=###foo{color: red}", |
+ "regexp=\\#\\#\\#foo\\{color\\:\\ red\\}"]); |
+ compareFilter(test, "foo.com##[-abp-properties='/margin: [3-4]{2}/']", |
+ ["type=elemhideemulation", |
+ "text=foo.com##[-abp-properties='/margin: [3-4]{2}/']", |
+ "selectorDomain=foo.com", |
+ "selector=[-abp-properties='/margin: [3-4]{2}/']", |
+ "domains=FOO.COM"]); |
+ compareFilter(test, "foo.com##[foo~='{bar}']", |
+ ["type=elemhide", |
+ "text=foo.com##[foo~='{bar}']", |
+ "selectorDomain=foo.com", |
+ "selector=[foo~='{bar}']", |
+ "domains=FOO.COM"]); |
+ compareFilter(test, "foo.com##''{color: red}''", |
+ ["type=filterlist", |
+ "text=foo.com##''{color: red}''", |
+ "regexp=foo\\.com\\#\\#\\'\\'\\{color\\:\\ red\\}\\'\\'"]); |
+ compareFilter(test, "foo.com##[foo='']{color: red}[foo='']", |
+ ["type=filterlist", |
+ "text=foo.com##[foo='']{color: red}[foo='']", |
+ "regexp=foo\\.com\\#\\#\\[foo\\=\\'\\'\\]\\{color\\:\\ red\\}\\[foo\\=\\'\\'\\]"]); |
+ test.done(); |
+}; |