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"]); |