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

Delta Between Two Patch Sets: test/elemHide.js

Issue 29757584: Issue 6562 - Remove the unused provideFilterKeys parameter (Closed)
Left Patch Set: Created April 20, 2018, 6:41 p.m.
Right Patch Set: Removed comment Created April 23, 2018, 10:17 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/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 29 matching lines...) Expand all
40 return selectors.sort().filter((selector, index, sortedSelectors) => 40 return selectors.sort().filter((selector, index, sortedSelectors) =>
41 { 41 {
42 return index == 0 || selector != sortedSelectors[index - 1]; 42 return index == 0 || selector != sortedSelectors[index - 1];
43 }); 43 });
44 } 44 }
45 45
46 function testResult(test, domain, expectedSelectors, criteria) 46 function testResult(test, domain, expectedSelectors, criteria)
47 { 47 {
48 let normalizedExpectedSelectors = normalizeSelectors(expectedSelectors); 48 let normalizedExpectedSelectors = normalizeSelectors(expectedSelectors);
49 49
50 // Test without filter keys
51 test.deepEqual( 50 test.deepEqual(
52 normalizeSelectors(ElemHide.getSelectorsForDomain(domain, criteria)), 51 normalizeSelectors(ElemHide.getSelectorsForDomain(domain, criteria)),
53 normalizedExpectedSelectors 52 normalizedExpectedSelectors
54 ); 53 );
55 } 54 }
56 55
57 exports.testGetSelectorsForDomain = function(test) 56 exports.testGetSelectorsForDomain = function(test)
58 { 57 {
59 let addFilter = filterText => ElemHide.add(Filter.fromText(filterText)); 58 let addFilter = filterText => ElemHide.add(Filter.fromText(filterText));
60 let removeFilter = filterText => ElemHide.remove(Filter.fromText(filterText)); 59 let removeFilter = filterText => ElemHide.remove(Filter.fromText(filterText));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 }; 238 };
240 239
241 exports.testZeroFilterKey = function(test) 240 exports.testZeroFilterKey = function(test)
242 { 241 {
243 ElemHide.add(Filter.fromText("##test")); 242 ElemHide.add(Filter.fromText("##test"));
244 ElemHide.add(Filter.fromText("foo.com#@#test")); 243 ElemHide.add(Filter.fromText("foo.com#@#test"));
245 testResult(test, "foo.com", []); 244 testResult(test, "foo.com", []);
246 testResult(test, "bar.com", ["test"]); 245 testResult(test, "bar.com", ["test"]);
247 test.done(); 246 test.done();
248 }; 247 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld