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

Delta Between Two Patch Sets: test/filterListener.js

Issue 29907586: Issue 6994 - Use shortcut matching for location only filters (Closed)
Left Patch Set: Created Oct. 12, 2018, 4:56 a.m.
Right Patch Set: Address PS4, and rebase Created Oct. 24, 2018, 8:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« lib/matcher.js ('K') | « lib/matcher.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
(no file at all)
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 let filters = []; 68 let filters = [];
69 for (let [keyword, set] of matcher._filterByKeyword) 69 for (let [keyword, set] of matcher._filterByKeyword)
70 { 70 {
71 for (let filter of set) 71 for (let filter of set)
72 { 72 {
73 test.equal(matcher.findKeyword(filter), keyword, 73 test.equal(matcher.findKeyword(filter), keyword,
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 for (let [keyword, set] of matcher._fastFilterByKeyword)
79 {
80 for (let filter of set)
81 {
82 test.equal(matcher.findKeyword(filter), keyword,
83 "Keyword of filter " + filter.text);
84 filters.push(filter.text);
85 }
86 }
78 result[type] = filters; 87 result[type] = filters;
79 } 88 }
80 89
81 let elemHide = sandboxedRequire("../lib/elemHide"); 90 let elemHide = sandboxedRequire("../lib/elemHide");
82 result.elemhide = []; 91 result.elemhide = [];
83 for (let filter of elemHide.knownFilters) 92 for (let filter of elemHide.knownFilters)
84 result.elemhide.push(filter.text); 93 result.elemhide.push(filter.text);
85 94
86 let elemHideExceptions = sandboxedRequire("../lib/elemHideExceptions"); 95 let elemHideExceptions = sandboxedRequire("../lib/elemHideExceptions");
87 result.elemhideexception = []; 96 result.elemhideexception = [];
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 checkKnownFilters(test, "add special subscription with filter2", {snippets: [f ilter1.text, filter2.text]}); 365 checkKnownFilters(test, "add special subscription with filter2", {snippets: [f ilter1.text, filter2.text]});
357 366
358 let subscription4 = Subscription.fromURL("https://easylist-downloads.adblockpl us.org/abp-filters-anti-cv.txt"); 367 let subscription4 = Subscription.fromURL("https://easylist-downloads.adblockpl us.org/abp-filters-anti-cv.txt");
359 subscription4.filters = [filter3]; 368 subscription4.filters = [filter3];
360 369
361 filterStorage.addSubscription(subscription4); 370 filterStorage.addSubscription(subscription4);
362 checkKnownFilters(test, "add ABP anti-circumvention subscription with filter3" , {snippets: [filter1.text, filter2.text, filter3.text]}); 371 checkKnownFilters(test, "add ABP anti-circumvention subscription with filter3" , {snippets: [filter1.text, filter2.text, filter3.text]});
363 372
364 test.done(); 373 test.done();
365 }; 374 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld