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

Delta Between Two Patch Sets: test/filterListener.js

Issue 29790555: Issue 6671 - Introduce trusted subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created May 25, 2018, 6:20 a.m.
Right Patch Set: Make user's own filters trusted Created May 25, 2018, 6:41 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/subscriptionClasses.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 {defaultMatcher} = sandboxedRequire("../lib/matcher") 47 {defaultMatcher} = sandboxedRequire("../lib/matcher")
48 ); 48 );
49 49
50 FilterStorage.addSubscription(Subscription.fromURL("~fl~")); 50 FilterStorage.addSubscription(Subscription.fromURL("~fl~"));
51 FilterStorage.addSubscription(Subscription.fromURL("~wl~")); 51 FilterStorage.addSubscription(Subscription.fromURL("~wl~"));
52 FilterStorage.addSubscription(Subscription.fromURL("~eh~")); 52 FilterStorage.addSubscription(Subscription.fromURL("~eh~"));
53 53
54 Subscription.fromURL("~fl~").defaults = ["blocking"]; 54 Subscription.fromURL("~fl~").defaults = ["blocking"];
55 Subscription.fromURL("~wl~").defaults = ["whitelist"]; 55 Subscription.fromURL("~wl~").defaults = ["whitelist"];
56 Subscription.fromURL("~eh~").defaults = ["elemhide"]; 56 Subscription.fromURL("~eh~").defaults = ["elemhide"];
57
58 Subscription.fromURL("~fl~").trusted = false;
57 59
58 callback(); 60 callback();
59 }; 61 };
60 62
61 function checkKnownFilters(test, text, expected) 63 function checkKnownFilters(test, text, expected)
62 { 64 {
63 let result = {}; 65 let result = {};
64 for (let type of ["blacklist", "whitelist"]) 66 for (let type of ["blacklist", "whitelist"])
65 { 67 {
66 let matcher = defaultMatcher[type]; 68 let matcher = defaultMatcher[type];
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]}); 325 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]});
324 326
325 FilterStorage.removeSubscription(subscription4); 327 FilterStorage.removeSubscription(subscription4);
326 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]}); 328 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]});
327 329
328 subscription3.disabled = false; 330 subscription3.disabled = false;
329 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]}); 331 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]});
330 332
331 test.done(); 333 test.done();
332 }; 334 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld