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

Unified Diff: test/filterClasses.js

Issue 29354864: Issue 4223 - Migrate some more of adblockplustests (Closed)
Patch Set: Addressed feedback Created Oct. 3, 2016, 1:44 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/filterClasses.js
diff --git a/test/filterClasses.js b/test/filterClasses.js
index a25d7673d0c44e0c3fbf771d400644ef83d00e16..cfc38d30eb909a2803959e9de5bc4a0485a48b66 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -17,11 +17,37 @@
"use strict";
-let {
- Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter,
- BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter,
- ElemHideException, CSSPropertyFilter
-} = require("../lib/filterClasses");
+let {createSandbox} = require("common");
+
+let Filter = null;
+let InvalidFilter = null;
+let CommentFilter = null;
+let ActiveFilter = null;
+let RegExpFilter = null;
+let BlockingFilter = null;
+let WhitelistFilter = null;
+let ElemHideBase = null;
+let ElemHideFilter = null;
+let ElemHideException = null;
+let CSSPropertyFilter = null;
+
+let t = null;
+let defaultTypes = null;
+
+exports.setUp = function(callback)
+{
+ let sandboxedRequire = createSandbox();
+ (
+ {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter,
+ BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter,
+ ElemHideException, CSSPropertyFilter} = sandboxedRequire("filterClasses")
+ );
+ t = RegExpFilter.typeMap;
+ defaultTypes = 0x7FFFFFFF & ~(t.ELEMHIDE | t.DOCUMENT | t.POPUP |
+ t.GENERICHIDE | t.GENERICBLOCK);
+
+ callback();
+};
function serializeFilter(filter)
{
@@ -244,9 +270,6 @@ exports.testFiltersWithState = function(test)
test.done();
};
-let t = RegExpFilter.typeMap;
-let defaultTypes = 0x7FFFFFFF & ~(t.ELEMHIDE | t.DOCUMENT | t.POPUP | t.GENERICHIDE | t.GENERICBLOCK);
-
exports.testSpecialCharacters = function(test)
{
compareFilter(test, "/ddd|f?a[s]d/", ["type=filterlist", "text=/ddd|f?a[s]d/", "regexp=ddd|f?a[s]d"]);
« 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