Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/filterClasses.js

Issue 29876561: Issue 6931 - Allow content filters for localhost (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 6, 2018, 10:26 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"]);
« no previous file with comments | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld