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

Unified Diff: test/abp2blocklist.js

Issue 29441592: Issue 4329 - Add $genericblock support (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Rebase Created May 21, 2017, 9:26 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
« no previous file with comments | « 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
@@ -165,16 +165,36 @@
{trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path",
"resource-type": ["font"]},
action: {type: "ignore-previous-rules"}}
]);
test.done();
},
+ testGenericblockExceptions: function(test)
+ {
+ testRules(test, ["^ad.jpg|", "@@||example.com^$genericblock"],
+ [[undefined, ["*example.com"]]],
+ rules => rules.map(rule => [rule.trigger["if-domain"],
+ rule.trigger["unless-domain"]]));
+ testRules(test, ["^ad.jpg|$domain=test.com",
+ "@@||example.com^$genericblock"],
+ [[["*test.com"], undefined]],
+ rules => rules.map(rule => [rule.trigger["if-domain"],
+ rule.trigger["unless-domain"]]));
+ testRules(test, ["^ad.jpg|$domain=~test.com",
+ "@@||example.com^$genericblock"],
+ [[undefined, ["*test.com", "*example.com"]]],
+ rules => rules.map(rule => [rule.trigger["if-domain"],
+ rule.trigger["unless-domain"]]));
+
+ test.done();
+ },
+
testRuleOrdering: function(test)
{
testRules(
test,
["/ads.jpg", "@@example.com", "test.com#@#foo", "##bar"],
["css-display-none", "block", "ignore-previous-rules"],
rules => rules.map(rule => rule.action.type)
);
@@ -216,17 +236,17 @@
);
test.done();
},
testUnsupportedfilters: function(test)
{
// These types of filters are currently completely unsupported.
- testRules(test, ["foo$sitekey=bar", "@@foo$genericblock"], []);
+ testRules(test, ["foo$sitekey=bar"], []);
test.done();
},
testFilterOptions: function(test)
{
testRules(test, ["1$domain=foo.com"], ["*foo.com"],
rules => rules[0]["trigger"]["if-domain"]);
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld