Index: chrome/content/tests/elemhide.js |
diff --git a/chrome/content/tests/elemhide.js b/chrome/content/tests/elemhide.js |
index c1b9d7a6c9433e8b1826bbf6fdd2587a6953db57..0778d496a222f4b13a3f3ae513c3eb7abb6ba2a0 100644 |
--- a/chrome/content/tests/elemhide.js |
+++ b/chrome/content/tests/elemhide.js |
@@ -106,6 +106,13 @@ |
[["localhost.###test1"], ["visible", "visible"]], |
[["localhost.,localhost###test1"], ["hidden", "visible"]], |
[["localhost.,foo.###test1"], ["visible", "visible"]], |
+ |
+ [["#div(test1)", "@@localhost$generichide"], ["visible", "visible"]], |
+ [["#div(test1)", "@@localhost$genericblock"], ["hidden", "visible"]], |
+ [["localhost#div(test1)", "@@localhost$generichide"], ["hidden", "visible"]], |
+ [["~example.com#div(test1)", "@@localhost$generichide"], ["visible", "visible"]], |
+ [["~example.com#div(test1)", "@@localhost$genericblock"], ["hidden", "visible"]], |
+ [["~example.com,localhost#div(test1)", "@@localhost$generichide"], ["hidden", "visible"]], |
]; |
function runTest([filters, expected], stage) |
@@ -138,11 +145,18 @@ |
}); |
}, false, true); |
frame.setAttribute("src", "http://localhost:1234/test"); |
+ }; |
+ |
+ for (let filter_text of filters) |
+ { |
+ let filter = Filter.fromText(filter_text); |
+ if (filter instanceof WhitelistFilter) |
Felix Dahlke
2015/10/01 11:53:40
What I (also) meant is that `!(filter instanceof E
kzar
2015/10/01 12:16:52
Ah I see, and good point. Unfortunately for reason
|
+ defaultMatcher.add(filter); |
+ else |
+ ElemHide.add(Filter.fromText(filter)); |
} |
- FilterNotifier.addListener(listener); |
- for (let filter of filters) |
- ElemHide.add(Filter.fromText(filter)); |
+ FilterNotifier.addListener(listener); |
ElemHide.isDirty = true; |
ElemHide.apply(); |
} |