Index: test/filterListener.js |
diff --git a/test/filterListener.js b/test/filterListener.js |
index 42cd0398e21398c6ff6c0f5411c39e9fb31f9ab2..d02466d8e21136455acab1e00440896031813581 100644 |
--- a/test/filterListener.js |
+++ b/test/filterListener.js |
@@ -25,12 +25,13 @@ let Subscription = null; |
let Filter = null; |
let defaultMatcher = null; |
let SpecialSubscription = null; |
+let ElemHideException = null; |
exports.setUp = function(callback) |
{ |
sandboxedRequire = createSandbox({ |
extraExports: { |
- elemHide: ["filterByKey", "exceptions"], |
+ elemHide: ["knownFilters"], |
elemHideEmulation: ["filters"] |
} |
}); |
@@ -42,7 +43,7 @@ exports.setUp = function(callback) |
( |
{FilterStorage} = sandboxedRequire("../lib/filterStorage"), |
{Subscription, SpecialSubscription} = sandboxedRequire("../lib/subscriptionClasses"), |
- {Filter} = sandboxedRequire("../lib/filterClasses"), |
+ {Filter, ElemHideException} = sandboxedRequire("../lib/filterClasses"), |
{defaultMatcher} = sandboxedRequire("../lib/matcher") |
); |
@@ -79,14 +80,13 @@ function checkKnownFilters(test, text, expected) |
let elemHide = sandboxedRequire("../lib/elemHide"); |
result.elemhide = []; |
- for (let key in elemHide.filterByKey) |
- result.elemhide.push(elemHide.filterByKey[key].text); |
- |
result.elemhideexception = []; |
- for (let [, list] of elemHide.exceptions) |
+ for (let filter of elemHide.knownFilters.values()) |
Manish Jethani
2018/04/27 12:39:36
Call .values is redundant here, but if you prefer
kzar
2018/04/30 10:11:46
Done.
|
{ |
- for (let exception of list) |
- result.elemhideexception.push(exception.text); |
+ if (filter instanceof ElemHideException) |
+ result.elemhideexception.push(filter.text); |
+ else |
+ result.elemhide.push(filter.text); |
} |
let elemHideEmulation = sandboxedRequire("../lib/elemHideEmulation"); |