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

Unified Diff: test/abp2blocklist.js

Issue 29473555: Issue 5345 - Whitelist $elemhide and $generichide domains where possible (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 24, 2017, 2:48 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
« lib/abp2blocklist.js ('K') | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/abp2blocklist.js
===================================================================
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -47,31 +47,28 @@
action: {type: "css-display-none", selector: ".whatever"}}
]);
test.done();
},
testElementHidingExceptions: function(test)
{
- // Element hiding rules should be in the following order: (1) generic
- // rules, (2) exceptions for generic rules, (3) domain-specific rules,
- // (4) exceptions for all rules.
testRules(test, [
"##.whatever",
"test.com###something",
"@@||special.test.com^$elemhide",
- "@@||test.com^$generichide"
+ "@@||test.com^$generichide",
+ "@@^something^$elemhide",
+ "@@^anything^$generichide"
], [
- ["^https?://", "css-display-none"],
- ["^https?://([^/]+\\.)?test\\.com", "ignore-previous-rules"],
- ["^https?://([^/:]*\\.)?test\\.com[/:]", "css-display-none"],
- ["^https?://([^/]+\\.)?special\\.test\\.com", "ignore-previous-rules"]
+ ["^https?://", ["*test.com", "*special.test.com"]],
+ ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]]
], rules => rules.map(rule => [rule.trigger["url-filter"],
- rule.action.type]));
+ rule.trigger["unless-domain"]]));
testRules(test, ["#@#whatever"], []);
testRules(test, ["test.com#@#whatever"], []);
testRules(test, ["~test.com#@#whatever"], []);
// We currently completely ignore any element hiding filters that have the
// same selector as an element hiding exception. In these examples #whatever
// should be hidden for all domains not ending in test.com instead of
« lib/abp2blocklist.js ('K') | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld