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

Unified Diff: test/domainRestrictions.js

Issue 29453590: Issue 5287 - Change syntax for element hiding emulation filters and remove simplified element hidin… (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 1, 2017, 12:01 p.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
Index: test/domainRestrictions.js
===================================================================
--- a/test/domainRestrictions.js
+++ b/test/domainRestrictions.js
@@ -49,22 +49,22 @@ exports.testUnrestrictedBlockingFilters
testActive(test, "foo", "foo.example.com", true, false);
testActive(test, "foo", "mple.com", true, false);
test.done();
};
exports.testUnrestrictedHidingRules = function(test)
{
- testActive(test, "#foo", null, true, false);
- testActive(test, "#foo", "com", true, false);
- testActive(test, "#foo", "example.com", true, false);
- testActive(test, "#foo", "example.com.", true, false);
- testActive(test, "#foo", "foo.example.com", true, false);
- testActive(test, "#foo", "mple.com", true, false);
+ testActive(test, "##foo", null, true, false);
+ testActive(test, "##foo", "com", true, false);
+ testActive(test, "##foo", "example.com", true, false);
+ testActive(test, "##foo", "example.com.", true, false);
+ testActive(test, "##foo", "foo.example.com", true, false);
+ testActive(test, "##foo", "mple.com", true, false);
test.done();
};
exports.testDomainRestrictedBlockingFilters = function(test)
{
testActive(test, "foo$domain=example.com", null, false, false);
testActive(test, "foo$domain=example.com", "com", false, true);
@@ -75,24 +75,24 @@ exports.testDomainRestrictedBlockingFilt
testActive(test, "foo$domain=example.com", "foo.example.com", true, false);
testActive(test, "foo$domain=example.com", "mple.com", false, false);
test.done();
};
exports.testDomainRestrictedHidingRules = function(test)
{
- testActive(test, "example.com#foo", null, false, false);
- testActive(test, "example.com#foo", "com", false, true);
- testActive(test, "example.com#foo", "example.com", true, true);
- testActive(test, "example.com#foo", "example.com.", false, false);
- testActive(test, "example.com.#foo", "example.com", false, false);
- testActive(test, "example.com.#foo", "example.com.", true, true);
- testActive(test, "example.com#foo", "foo.example.com", true, false);
- testActive(test, "example.com#foo", "mple.com", false, false);
+ testActive(test, "example.com##foo", null, false, false);
+ testActive(test, "example.com##foo", "com", false, true);
+ testActive(test, "example.com##foo", "example.com", true, true);
+ testActive(test, "example.com##foo", "example.com.", false, false);
+ testActive(test, "example.com.##foo", "example.com", false, false);
+ testActive(test, "example.com.##foo", "example.com.", true, true);
+ testActive(test, "example.com##foo", "foo.example.com", true, false);
+ testActive(test, "example.com##foo", "mple.com", false, false);
test.done();
};
exports.testBlockingFiltersRestrictedToDomainAndItsSubdomain = function(test)
{
testActive(test, "foo$domain=example.com|foo.example.com", null, false, false);
testActive(test, "foo$domain=example.com|foo.example.com", "com", false, true);
@@ -101,22 +101,22 @@ exports.testBlockingFiltersRestrictedToD
testActive(test, "foo$domain=example.com|foo.example.com", "foo.example.com", true, false);
testActive(test, "foo$domain=example.com|foo.example.com", "mple.com", false, false);
test.done();
};
exports.testHidingRulesRestrictedToDomainAndItsSubdomain = function(test)
{
- testActive(test, "example.com,foo.example.com#foo", null, false, false);
- testActive(test, "example.com,foo.example.com#foo", "com", false, true);
- testActive(test, "example.com,foo.example.com#foo", "example.com", true, true);
- testActive(test, "example.com,foo.example.com#foo", "example.com.", false, false);
- testActive(test, "example.com,foo.example.com#foo", "foo.example.com", true, false);
- testActive(test, "example.com,foo.example.com#foo", "mple.com", false, false);
+ testActive(test, "example.com,foo.example.com##foo", null, false, false);
+ testActive(test, "example.com,foo.example.com##foo", "com", false, true);
+ testActive(test, "example.com,foo.example.com##foo", "example.com", true, true);
+ testActive(test, "example.com,foo.example.com##foo", "example.com.", false, false);
+ testActive(test, "example.com,foo.example.com##foo", "foo.example.com", true, false);
+ testActive(test, "example.com,foo.example.com##foo", "mple.com", false, false);
test.done();
};
exports.testBlockingFiltersWithExceptionForASubdomain = function(test)
{
testActive(test, "foo$domain=~foo.example.com", null, true, false);
testActive(test, "foo$domain=~foo.example.com", "com", true, false);
@@ -125,22 +125,22 @@ exports.testBlockingFiltersWithException
testActive(test, "foo$domain=~foo.example.com", "foo.example.com", false, false);
testActive(test, "foo$domain=~foo.example.com", "mple.com", true, false);
test.done();
};
exports.testHidingRulesWithExceptionForASubdomain = function(test)
{
- testActive(test, "~foo.example.com#foo", null, true, false);
- testActive(test, "~foo.example.com#foo", "com", true, false);
- testActive(test, "~foo.example.com#foo", "example.com", true, false);
- testActive(test, "~foo.example.com#foo", "example.com.", true, false);
- testActive(test, "~foo.example.com#foo", "foo.example.com", false, false);
- testActive(test, "~foo.example.com#foo", "mple.com", true, false);
+ testActive(test, "~foo.example.com##foo", null, true, false);
+ testActive(test, "~foo.example.com##foo", "com", true, false);
+ testActive(test, "~foo.example.com##foo", "example.com", true, false);
+ testActive(test, "~foo.example.com##foo", "example.com.", true, false);
+ testActive(test, "~foo.example.com##foo", "foo.example.com", false, false);
+ testActive(test, "~foo.example.com##foo", "mple.com", true, false);
test.done();
};
exports.testBlockingFiltersForDomainButNotItsSubdomain = function(test)
{
testActive(test, "foo$domain=example.com|~foo.example.com", null, false, false);
testActive(test, "foo$domain=example.com|~foo.example.com", "com", false, true);
@@ -149,22 +149,22 @@ exports.testBlockingFiltersForDomainButN
testActive(test, "foo$domain=example.com|~foo.example.com", "foo.example.com", false, false);
testActive(test, "foo$domain=example.com|~foo.example.com", "mple.com", false, false);
test.done();
};
exports.testHidingRulesForDomainButNotItsSubdomain = function(test)
{
- testActive(test, "example.com,~foo.example.com#foo", null, false, false);
- testActive(test, "example.com,~foo.example.com#foo", "com", false, true);
- testActive(test, "example.com,~foo.example.com#foo", "example.com", true, true);
- testActive(test, "example.com,~foo.example.com#foo", "example.com.", false, false);
- testActive(test, "example.com,~foo.example.com#foo", "foo.example.com", false, false);
- testActive(test, "example.com,~foo.example.com#foo", "mple.com", false, false);
+ testActive(test, "example.com,~foo.example.com##foo", null, false, false);
+ testActive(test, "example.com,~foo.example.com##foo", "com", false, true);
+ testActive(test, "example.com,~foo.example.com##foo", "example.com", true, true);
+ testActive(test, "example.com,~foo.example.com##foo", "example.com.", false, false);
+ testActive(test, "example.com,~foo.example.com##foo", "foo.example.com", false, false);
+ testActive(test, "example.com,~foo.example.com##foo", "mple.com", false, false);
test.done();
};
exports.testBlockingFiltersForDomainButNotItsTLD = function(test)
{
testActive(test, "foo$domain=example.com|~com", null, false, false);
testActive(test, "foo$domain=example.com|~com", "com", false, true);
@@ -173,22 +173,22 @@ exports.testBlockingFiltersForDomainButN
testActive(test, "foo$domain=example.com|~com", "foo.example.com", true, false);
testActive(test, "foo$domain=example.com|~com", "mple.com", false, false);
test.done();
};
exports.testHidingRulesForDomainButNotItsTLD = function(test)
{
- testActive(test, "example.com,~com#foo", null, false, false);
- testActive(test, "example.com,~com#foo", "com", false, true);
- testActive(test, "example.com,~com#foo", "example.com", true, true);
- testActive(test, "example.com,~com#foo", "example.com.", false, false);
- testActive(test, "example.com,~com#foo", "foo.example.com", true, false);
- testActive(test, "example.com,~com#foo", "mple.com", false, false);
+ testActive(test, "example.com,~com##foo", null, false, false);
+ testActive(test, "example.com,~com##foo", "com", false, true);
+ testActive(test, "example.com,~com##foo", "example.com", true, true);
+ testActive(test, "example.com,~com##foo", "example.com.", false, false);
+ testActive(test, "example.com,~com##foo", "foo.example.com", true, false);
+ testActive(test, "example.com,~com##foo", "mple.com", false, false);
test.done();
};
exports.testBlockingFiltersRestrictedToAnUnrelatedDomain = function(test)
{
testActive(test, "foo$domain=nnnnnnn.nnn", null, false, false);
testActive(test, "foo$domain=nnnnnnn.nnn", "com", false, false);
@@ -197,18 +197,17 @@ exports.testBlockingFiltersRestrictedToA
testActive(test, "foo$domain=nnnnnnn.nnn", "foo.example.com", false, false);
testActive(test, "foo$domain=nnnnnnn.nnn", "mple.com", false, false);
test.done();
};
exports.testHidingRulesRestrictedToAnUnrelatedDomain = function(test)
{
- testActive(test, "nnnnnnn.nnn#foo", null, false, false);
- testActive(test, "nnnnnnn.nnn#foo", "com", false, false);
- testActive(test, "nnnnnnn.nnn#foo", "example.com", false, false);
- testActive(test, "nnnnnnn.nnn#foo", "example.com.", false, false);
- testActive(test, "nnnnnnn.nnn#foo", "foo.example.com", false, false);
- testActive(test, "nnnnnnn.nnn#foo", "mple.com", false, false);
+ testActive(test, "nnnnnnn.nnn##foo", null, false, false);
+ testActive(test, "nnnnnnn.nnn##foo", "com", false, false);
+ testActive(test, "nnnnnnn.nnn##foo", "example.com", false, false);
+ testActive(test, "nnnnnnn.nnn##foo", "example.com.", false, false);
+ testActive(test, "nnnnnnn.nnn##foo", "foo.example.com", false, false);
+ testActive(test, "nnnnnnn.nnn##foo", "mple.com", false, false);
test.done();
};
-

Powered by Google App Engine
This is Rietveld