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

Unified Diff: test/elemHideEmulation.js

Issue 29783618: Issue 6665 - Split out element hiding exceptions into their own module (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Add lib/elemHideExceptions.js Created Aug. 7, 2018, 2:18 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 | « test/elemHide.js ('k') | test/filterListener.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/elemHideEmulation.js
===================================================================
--- a/test/elemHideEmulation.js
+++ b/test/elemHideEmulation.js
@@ -16,51 +16,51 @@
*/
"use strict";
const {createSandbox} = require("./_common");
let ElemHideEmulationFilter = null;
let ElemHideEmulation = null;
-let ElemHide = null;
+let ElemHideExceptions = null;
let Filter = null;
exports.setUp = function(callback)
{
let sandboxedRequire = createSandbox();
(
{Filter,
ElemHideEmulationFilter} = sandboxedRequire("../lib/filterClasses"),
{ElemHideEmulation} = sandboxedRequire("../lib/elemHideEmulation"),
- {ElemHide} = sandboxedRequire("../lib/elemHide")
+ {ElemHideExceptions} = sandboxedRequire("../lib/elemHideExceptions")
);
callback();
};
exports.testDomainRestrictions = function(test)
{
function testSelectorMatches(description, filters, domain, expectedMatches)
{
for (let filter of filters)
{
filter = Filter.fromText(filter);
if (filter instanceof ElemHideEmulationFilter)
ElemHideEmulation.add(filter);
else
- ElemHide.add(filter);
+ ElemHideExceptions.add(filter);
}
let matches = ElemHideEmulation.getRulesForDomain(domain)
.map(filter => filter.text);
test.deepEqual(matches.sort(), expectedMatches.sort(), description);
ElemHideEmulation.clear();
- ElemHide.clear();
+ ElemHideExceptions.clear();
}
testSelectorMatches(
"Ignore generic filters",
[
"#?#:-abp-properties(foo)", "example.com#?#:-abp-properties(foo)",
"~example.com#?#:-abp-properties(foo)"
],
« no previous file with comments | « test/elemHide.js ('k') | test/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld