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

Delta Between Two Patch Sets: test/filterListener.js

Issue 29757591: Issue 6562 - Remove filter keys from the element hiding code (Closed)
Left Patch Set: Avoid adding duplicate hiding filters Created April 26, 2018, noon
Right Patch Set: == instead of === Created May 4, 2018, 12:05 p.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/elemHide.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 "Keyword of filter " + filter.text); 74 "Keyword of filter " + filter.text);
75 filters.push(filter.text); 75 filters.push(filter.text);
76 } 76 }
77 } 77 }
78 result[type] = filters; 78 result[type] = filters;
79 } 79 }
80 80
81 let elemHide = sandboxedRequire("../lib/elemHide"); 81 let elemHide = sandboxedRequire("../lib/elemHide");
82 result.elemhide = []; 82 result.elemhide = [];
83 result.elemhideexception = []; 83 result.elemhideexception = [];
84 for (let filter of elemHide.knownFilters.values()) 84 for (let filter of elemHide.knownFilters)
Manish Jethani 2018/04/27 12:39:36 Call .values is redundant here, but if you prefer
kzar 2018/04/30 10:11:46 Done.
85 { 85 {
86 if (filter instanceof ElemHideException) 86 if (filter instanceof ElemHideException)
87 result.elemhideexception.push(filter.text); 87 result.elemhideexception.push(filter.text);
88 else 88 else
89 result.elemhide.push(filter.text); 89 result.elemhide.push(filter.text);
90 } 90 }
91 91
92 let elemHideEmulation = sandboxedRequire("../lib/elemHideEmulation"); 92 let elemHideEmulation = sandboxedRequire("../lib/elemHideEmulation");
93 result.elemhideemulation = []; 93 result.elemhideemulation = [];
94 for (let filterText of elemHideEmulation.filters) 94 for (let filterText of elemHideEmulation.filters)
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]}); 318 checkKnownFilters(test, "disable exception rules", {blacklist: [filter1.text, filter3.text], whitelist: [filter2.text]});
319 319
320 FilterStorage.removeSubscription(subscription4); 320 FilterStorage.removeSubscription(subscription4);
321 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]}); 321 checkKnownFilters(test, "remove subscription from the list", {blacklist: [filt er1.text]});
322 322
323 subscription3.disabled = false; 323 subscription3.disabled = false;
324 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]}); 324 checkKnownFilters(test, "enable exception rules", {blacklist: [filter1.text], whitelist: [filter2.text]});
325 325
326 test.done(); 326 test.done();
327 }; 327 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld