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

Delta Between Two Patch Sets: test/elemHide.js

Issue 29783618: Issue 6665 - Split out element hiding exceptions into their own module (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created May 17, 2018, 3:46 a.m.
Right Patch Set: Add lib/elemHideExceptions.js Created Aug. 7, 2018, 2:18 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/filterListener.js ('k') | test/elemHideEmulation.js » ('j') | 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 removeFilter("~foo.example.com,example.com##foo"); 179 removeFilter("~foo.example.com,example.com##foo");
180 180
181 // Test criteria 181 // Test criteria
182 addFilter("##hello"); 182 addFilter("##hello");
183 addFilter("~example.com##world"); 183 addFilter("~example.com##world");
184 addFilter("foo.com##specific"); 184 addFilter("foo.com##specific");
185 testResult(test, "foo.com", ["specific"], true); 185 testResult(test, "foo.com", ["specific"], true);
186 testResult(test, "foo.com", ["hello", "specific", "world"], false); 186 testResult(test, "foo.com", ["hello", "specific", "world"], false);
187 testResult(test, "foo.com", ["hello", "specific", "world"]); 187 testResult(test, "foo.com", ["hello", "specific", "world"]);
188 testResult(test, "foo.com.", ["hello", "specific", "world"]);
189 testResult(test, "example.com", [], true);
188 removeFilter("foo.com##specific"); 190 removeFilter("foo.com##specific");
189 removeFilter("~example.com##world"); 191 removeFilter("~example.com##world");
190 removeFilter("##hello"); 192 removeFilter("##hello");
191 testResult(test, "foo.com", []); 193 testResult(test, "foo.com", []);
192 194
193 addFilter("##hello"); 195 addFilter("##hello");
194 testResult(test, "foo.com", [], true); 196 testResult(test, "foo.com", [], true);
195 testResult(test, "foo.com", ["hello"], false); 197 testResult(test, "foo.com", ["hello"], false);
196 testResult(test, "foo.com", ["hello"]); 198 testResult(test, "foo.com", ["hello"]);
197 testResult(test, "bar.com", [], true); 199 testResult(test, "bar.com", [], true);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 }; 239 };
238 240
239 exports.testZeroFilterKey = function(test) 241 exports.testZeroFilterKey = function(test)
240 { 242 {
241 ElemHide.add(Filter.fromText("##test")); 243 ElemHide.add(Filter.fromText("##test"));
242 ElemHideExceptions.add(Filter.fromText("foo.com#@#test")); 244 ElemHideExceptions.add(Filter.fromText("foo.com#@#test"));
243 testResult(test, "foo.com", []); 245 testResult(test, "foo.com", []);
244 testResult(test, "bar.com", ["test"]); 246 testResult(test, "bar.com", ["test"]);
245 test.done(); 247 test.done();
246 }; 248 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld