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

Side by Side Diff: test/filterListener.js

Issue 29355872: Issue 4223 - Adapt synchronizer tests to work in adblockpluscore repository (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Converted former loops into separate tests Created Oct. 5, 2016, 9:24 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 11 matching lines...) Expand all
22 22
23 let FilterStorage = null; 23 let FilterStorage = null;
24 let Subscription = null; 24 let Subscription = null;
25 let Filter = null; 25 let Filter = null;
26 let defaultMatcher = null; 26 let defaultMatcher = null;
27 let SpecialSubscription = null; 27 let SpecialSubscription = null;
28 28
29 exports.setUp = function(callback) 29 exports.setUp = function(callback)
30 { 30 {
31 sandboxedRequire = createSandbox({ 31 sandboxedRequire = createSandbox({
32 elemHide: ["filterByKey", "exceptions"], 32 extraExports: {
33 cssRules: ["filters"] 33 elemHide: ["filterByKey", "exceptions"],
34 cssRules: ["filters"]
35 }
34 }); 36 });
35 37
36 // We need to require the filterListener module so that filter changes will be 38 // We need to require the filterListener module so that filter changes will be
37 // noticed, even though we don't directly use the module here. 39 // noticed, even though we don't directly use the module here.
38 sandboxedRequire("../lib/filterListener"); 40 sandboxedRequire("../lib/filterListener");
39 41
40 ( 42 (
41 {FilterStorage} = sandboxedRequire("../lib/filterStorage"), 43 {FilterStorage} = sandboxedRequire("../lib/filterStorage"),
42 {Subscription, SpecialSubscription} = sandboxedRequire("../lib/subscriptionC lasses"), 44 {Subscription, SpecialSubscription} = sandboxedRequire("../lib/subscriptionC lasses"),
43 {Filter} = sandboxedRequire("../lib/filterClasses"), 45 {Filter} = sandboxedRequire("../lib/filterClasses"),
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]}); 320 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]});
319 321
320 FilterStorage.removeSubscription(subscription4); 322 FilterStorage.removeSubscription(subscription4);
321 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]}); 323 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]});
322 324
323 subscription3.disabled = false; 325 subscription3.disabled = false;
324 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]}); 326 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]});
325 327
326 test.done(); 328 test.done();
327 }; 329 };
OLDNEW
« no previous file with comments | « test/_common.js ('k') | test/stub-modules/info.js » ('j') | test/synchronizer.js » ('J')

Powered by Google App Engine
This is Rietveld