OLD | NEW |
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 test.done(); | 293 test.done(); |
294 }; | 294 }; |
295 | 295 |
296 exports.testSpecialCharacters = function(test) | 296 exports.testSpecialCharacters = function(test) |
297 { | 297 { |
298 compareFilter(test, "/ddd|f?a[s]d/", ["type=filterlist", "text=/ddd|f?a[s]d/",
"regexp=ddd|f?a[s]d"]); | 298 compareFilter(test, "/ddd|f?a[s]d/", ["type=filterlist", "text=/ddd|f?a[s]d/",
"regexp=ddd|f?a[s]d"]); |
299 compareFilter(test, "*asdf*d**dd*", ["type=filterlist", "text=*asdf*d**dd*", "
regexp=asdf.*d.*dd"]); | 299 compareFilter(test, "*asdf*d**dd*", ["type=filterlist", "text=*asdf*d**dd*", "
regexp=asdf.*d.*dd"]); |
300 compareFilter(test, "|*asd|f*d**dd*|", ["type=filterlist", "text=|*asd|f*d**dd
*|", "regexp=^.*asd\\|f.*d.*dd.*$"]); | 300 compareFilter(test, "|*asd|f*d**dd*|", ["type=filterlist", "text=|*asd|f*d**dd
*|", "regexp=^.*asd\\|f.*d.*dd.*$"]); |
301 compareFilter(test, "dd[]{}$%<>&()d", ["type=filterlist", "text=dd[]{}$%<>&()d
", "regexp=dd\\[\\]\\{\\}\\$\\%\\<\\>\\&\\(\\)d"]); | 301 compareFilter(test, "dd[]{}$%<>&()d", ["type=filterlist", "text=dd[]{}$%<>&()d
", "regexp=dd\\[\\]\\{\\}\\$\\%\\<\\>\\&\\(\\)d"]); |
302 | 302 |
| 303 // No optimizations for rewrite filters (#6868). |
| 304 compareFilter(test, "*asdf*d**dd*$rewrite=", ["type=filterlist", "text=*asdf*d
**dd*$rewrite=", "regexp=.*asdf.*d.*.*dd.*", "rewrite=", "contentType=" + (defau
ltTypes & ~(t.SCRIPT | t.SUBDOCUMENT | t.OBJECT | t.OBJECT_SUBREQUEST))]); |
| 305 |
303 compareFilter(test, "@@/ddd|f?a[s]d/", ["type=whitelist", "text=@@/ddd|f?a[s]d
/", "regexp=ddd|f?a[s]d", "contentType=" + defaultTypes]); | 306 compareFilter(test, "@@/ddd|f?a[s]d/", ["type=whitelist", "text=@@/ddd|f?a[s]d
/", "regexp=ddd|f?a[s]d", "contentType=" + defaultTypes]); |
304 compareFilter(test, "@@*asdf*d**dd*", ["type=whitelist", "text=@@*asdf*d**dd*"
, "regexp=asdf.*d.*dd", "contentType=" + defaultTypes]); | 307 compareFilter(test, "@@*asdf*d**dd*", ["type=whitelist", "text=@@*asdf*d**dd*"
, "regexp=asdf.*d.*dd", "contentType=" + defaultTypes]); |
305 compareFilter(test, "@@|*asd|f*d**dd*|", ["type=whitelist", "text=@@|*asd|f*d*
*dd*|", "regexp=^.*asd\\|f.*d.*dd.*$", "contentType=" + defaultTypes]); | 308 compareFilter(test, "@@|*asd|f*d**dd*|", ["type=whitelist", "text=@@|*asd|f*d*
*dd*|", "regexp=^.*asd\\|f.*d.*dd.*$", "contentType=" + defaultTypes]); |
306 compareFilter(test, "@@dd[]{}$%<>&()d", ["type=whitelist", "text=@@dd[]{}$%<>&
()d", "regexp=dd\\[\\]\\{\\}\\$\\%\\<\\>\\&\\(\\)d", "contentType=" + defaultTyp
es]); | 309 compareFilter(test, "@@dd[]{}$%<>&()d", ["type=whitelist", "text=@@dd[]{}$%<>&
()d", "regexp=dd\\[\\]\\{\\}\\$\\%\\<\\>\\&\\(\\)d", "contentType=" + defaultTyp
es]); |
307 | 310 |
308 test.done(); | 311 test.done(); |
309 }; | 312 }; |
310 | 313 |
311 exports.testFilterOptions = function(test) | 314 exports.testFilterOptions = function(test) |
312 { | 315 { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 // This compares the references to make sure that both refer to the same | 614 // This compares the references to make sure that both refer to the same |
612 // object (#6815). | 615 // object (#6815). |
613 test.equal(filter1.domains, filter2.domains); | 616 test.equal(filter1.domains, filter2.domains); |
614 | 617 |
615 let filter3 = Filter.fromText("www.example.com##.bar"); | 618 let filter3 = Filter.fromText("www.example.com##.bar"); |
616 | 619 |
617 test.notEqual(filter2.domains, filter3.domains); | 620 test.notEqual(filter2.domains, filter3.domains); |
618 | 621 |
619 test.done(); | 622 test.done(); |
620 }; | 623 }; |
OLD | NEW |