Index: test/abp2blocklist.js |
=================================================================== |
--- a/test/abp2blocklist.js |
+++ b/test/abp2blocklist.js |
@@ -149,16 +149,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) |
); |
@@ -200,18 +220,17 @@ |
); |
test.done(); |
}, |
testUnsupportedfilters: function(test) |
{ |
// These types of filters are currently completely unsupported. |
- testRules(test, ["foo$sitekey=bar", "@@foo$genericblock", |
- "@@bar$generichide"], []); |
+ testRules(test, ["foo$sitekey=bar", "@@bar$generichide"], []); |
test.done(); |
}, |
testFilterOptions: function(test) |
{ |
testRules(test, ["1$domain=foo.com"], ["*foo.com"], |
rules => rules[0]["trigger"]["if-domain"]); |