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

Side by Side Diff: test/elemHide.js

Issue 29790629: Issue 6690 - Always ignore trailing dot in document domain (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Ignore trailing dot in ElemHide.getSelectorsForDomain Created May 26, 2018, 12:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/domainRestrictions.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 removeFilter("~foo.example.com,example.com##foo"); 173 removeFilter("~foo.example.com,example.com##foo");
174 174
175 // Test criteria 175 // Test criteria
176 addFilter("##hello"); 176 addFilter("##hello");
177 addFilter("~example.com##world"); 177 addFilter("~example.com##world");
178 addFilter("foo.com##specific"); 178 addFilter("foo.com##specific");
179 testResult(test, "foo.com", ["specific"], true); 179 testResult(test, "foo.com", ["specific"], true);
180 testResult(test, "foo.com", ["hello", "specific", "world"], false); 180 testResult(test, "foo.com", ["hello", "specific", "world"], false);
181 testResult(test, "foo.com", ["hello", "specific", "world"]); 181 testResult(test, "foo.com", ["hello", "specific", "world"]);
182 testResult(test, "foo.com.", ["hello", "specific", "world"]);
182 removeFilter("foo.com##specific"); 183 removeFilter("foo.com##specific");
183 removeFilter("~example.com##world"); 184 removeFilter("~example.com##world");
184 removeFilter("##hello"); 185 removeFilter("##hello");
185 testResult(test, "foo.com", []); 186 testResult(test, "foo.com", []);
186 187
187 addFilter("##hello"); 188 addFilter("##hello");
188 testResult(test, "foo.com", [], true); 189 testResult(test, "foo.com", [], true);
189 testResult(test, "foo.com", ["hello"], false); 190 testResult(test, "foo.com", ["hello"], false);
190 testResult(test, "foo.com", ["hello"]); 191 testResult(test, "foo.com", ["hello"]);
191 testResult(test, "bar.com", [], true); 192 testResult(test, "bar.com", [], true);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 }; 232 };
232 233
233 exports.testZeroFilterKey = function(test) 234 exports.testZeroFilterKey = function(test)
234 { 235 {
235 ElemHide.add(Filter.fromText("##test")); 236 ElemHide.add(Filter.fromText("##test"));
236 ElemHide.add(Filter.fromText("foo.com#@#test")); 237 ElemHide.add(Filter.fromText("foo.com#@#test"));
237 testResult(test, "foo.com", []); 238 testResult(test, "foo.com", []);
238 testResult(test, "bar.com", ["test"]); 239 testResult(test, "bar.com", ["test"]);
239 test.done(); 240 test.done();
240 }; 241 };
OLDNEW
« no previous file with comments | « test/domainRestrictions.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld