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

Unified Diff: test/elemHide.js

Issue 29935564: Issue 7452 - Do not cache element hiding filter objects by default Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rename filter* to filterText* Created April 8, 2019, 9:59 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/filterListener.js ('k') | test/filterListener.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/elemHide.js
===================================================================
--- a/test/elemHide.js
+++ b/test/elemHide.js
@@ -19,29 +19,29 @@
const {createSandbox} = require("./_common");
let ElemHide = null;
let createStyleSheet = null;
let rulesFromStyleSheet = null;
let ElemHideExceptions = null;
let Filter = null;
-let filtersByDomain = null;
+let filterTextByDomain = null;
let selectorGroupSize = null;
exports.setUp = function(callback)
{
let sandboxedRequire = createSandbox({
extraExports: {
- elemHide: ["filtersByDomain", "selectorGroupSize"]
+ elemHide: ["filterTextByDomain", "selectorGroupSize"]
}
});
(
{ElemHide, createStyleSheet, rulesFromStyleSheet,
- filtersByDomain, selectorGroupSize} = sandboxedRequire("../lib/elemHide"),
+ filterTextByDomain, selectorGroupSize} = sandboxedRequire("../lib/elemHide"),
{ElemHideExceptions} = sandboxedRequire("../lib/elemHideExceptions"),
{Filter} = sandboxedRequire("../lib/filterClasses")
);
callback();
};
function normalizeSelectors(selectors)
@@ -275,32 +275,32 @@
ElemHideExceptions.add(Filter.fromText("foo.com#@#test"));
testResult(test, "foo.com", [], {expectedExceptions: ["foo.com#@#test"]});
testResult(test, "bar.com", ["test"]);
test.done();
};
exports.testFiltersByDomain = function(test)
{
- test.equal(filtersByDomain.size, 0);
+ test.equal(filterTextByDomain.size, 0);
ElemHide.add(Filter.fromText("##test"));
- test.equal(filtersByDomain.size, 0);
+ test.equal(filterTextByDomain.size, 0);
ElemHide.add(Filter.fromText("example.com##test"));
- test.equal(filtersByDomain.size, 1);
+ test.equal(filterTextByDomain.size, 1);
ElemHide.add(Filter.fromText("example.com,~www.example.com##test"));
- test.equal(filtersByDomain.size, 2);
+ test.equal(filterTextByDomain.size, 2);
ElemHide.remove(Filter.fromText("example.com##test"));
- test.equal(filtersByDomain.size, 2);
+ test.equal(filterTextByDomain.size, 2);
ElemHide.remove(Filter.fromText("example.com,~www.example.com##test"));
- test.equal(filtersByDomain.size, 0);
+ test.equal(filterTextByDomain.size, 0);
test.done();
};
exports.testCreateStyleSheet = function(test)
{
test.equal(
createStyleSheet([
« no previous file with comments | « lib/filterListener.js ('k') | test/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld