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

Unified Diff: test/filterListener.js

Issue 29757591: Issue 6562 - Remove filter keys from the element hiding code (Closed)
Patch Set: Only note excluded filters and only if the domain isn't "" Created May 2, 2018, 4:21 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/elemHide.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterListener.js
diff --git a/test/filterListener.js b/test/filterListener.js
index 42cd0398e21398c6ff6c0f5411c39e9fb31f9ab2..3f23cff3ba9bc571d11d973750c74dc0158d4eb5 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)
{
- 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");
« no previous file with comments | « lib/elemHide.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld