Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -256,18 +256,16 @@ |
"type=invalid", "text=" + filterText, |
"reason=filter_elemhideemulation_nodomain" |
] |
); |
} |
checkElemHideEmulationFilterInvalid(""); |
checkElemHideEmulationFilterInvalid("~foo.com"); |
checkElemHideEmulationFilterInvalid("~foo.com,~bar.com"); |
- checkElemHideEmulationFilterInvalid("foo"); |
- checkElemHideEmulationFilterInvalid("~foo.com,bar"); |
test.done(); |
}; |
exports.testFiltersWithState = function(test) |
{ |
compareFilter(test, "blabla", ["type=filterlist", "text=blabla", "regexp=blabla"]); |
compareFilter( |
@@ -376,16 +374,19 @@ |
compareFilter(test, "foo,~baz,bar#@#ddd", ["type=elemhideexception", "text=foo,~baz,bar#@#ddd", "selectorDomains=foo,bar", "selector=ddd", "domains=bar|foo|~baz"]); |
test.done(); |
}; |
exports.testElemHideEmulationFilters = function(test) |
{ |
// Check valid domain combinations |
+ compareFilter(test, "foo#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=foo#?#:-abp-properties(abc)", "selectorDomains=foo", "selector=:-abp-properties(abc)", "domains=foo"]); |
+ compareFilter(test, "foo,~bar#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=foo,~bar#?#:-abp-properties(abc)", "selectorDomains=foo", "selector=:-abp-properties(abc)", "domains=foo|~bar"]); |
+ compareFilter(test, "~foo,bar#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=~foo,bar#?#:-abp-properties(abc)", "selectorDomains=bar", "selector=:-abp-properties(abc)", "domains=bar|~foo"]); |
compareFilter(test, "fOO.cOm#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=fOO.cOm#?#:-abp-properties(abc)", "selectorDomains=foo.com", "selector=:-abp-properties(abc)", "domains=foo.com"]); |
compareFilter(test, "Foo.com,~bAr.com#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=Foo.com,~bAr.com#?#:-abp-properties(abc)", "selectorDomains=foo.com", "selector=:-abp-properties(abc)", "domains=foo.com|~bar.com"]); |
compareFilter(test, "foo.com,~baR#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=foo.com,~baR#?#:-abp-properties(abc)", "selectorDomains=foo.com", "selector=:-abp-properties(abc)", "domains=foo.com|~bar"]); |
compareFilter(test, "~foo.com,bar.com#?#:-abp-properties(abc)", ["type=elemhideemulation", "text=~foo.com,bar.com#?#:-abp-properties(abc)", "selectorDomains=bar.com", "selector=:-abp-properties(abc)", "domains=bar.com|~foo.com"]); |
// Check some special cases |
compareFilter(test, "#?#:-abp-properties(abc)", ["type=invalid", "text=#?#:-abp-properties(abc)", "reason=filter_elemhideemulation_nodomain"]); |
compareFilter(test, "foo.com#?#abc", ["type=elemhideemulation", "text=foo.com#?#abc", "selectorDomains=foo.com", "selector=abc", "domains=foo.com"]); |