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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 test, "foo.com#?#:-abp-properties(/margin: [3-4]{2}/)", [ | 399 test, "foo.com#?#:-abp-properties(/margin: [3-4]{2}/)", [ |
400 "type=elemhideemulation", | 400 "type=elemhideemulation", |
401 "text=foo.com#?#:-abp-properties(/margin: [3-4]{2}/)", | 401 "text=foo.com#?#:-abp-properties(/margin: [3-4]{2}/)", |
402 "selectorDomain=foo.com", | 402 "selectorDomain=foo.com", |
403 "selector=:-abp-properties(/margin: [3-4]\\7B 2\\7D /)", | 403 "selector=:-abp-properties(/margin: [3-4]\\7B 2\\7D /)", |
404 "domains=FOO.COM" | 404 "domains=FOO.COM" |
405 ] | 405 ] |
406 ); | 406 ); |
407 test.done(); | 407 test.done(); |
408 }; | 408 }; |
| 409 |
| 410 exports.testFilterNormalisation = function(test) |
| 411 { |
| 412 compareFilter(test, Filter.stripJunk(" domain.c om## #sele ctor "), [ |
| 413 "type=elemhide", |
| 414 "text=domain.com###sele ctor", |
| 415 "selectorDomain=domain.com", |
| 416 "selector=#sele ctor", |
| 417 "domains=DOMAIN.COM" |
| 418 ]); |
| 419 compareFilter(test, Filter.stripJunk(" ! fo o## bar "), [ |
| 420 "type=comment", "text=! fo o## bar" |
| 421 ]); |
| 422 compareFilter(test, Filter.stripJunk(" bl a$sitekey= foo ,domain= do ma
in.com |foo .com "), [ |
| 423 "type=filterlist", |
| 424 "text=bla$sitekey=foo,domain=domain.com|foo.com", |
| 425 "regexp=bla", |
| 426 "sitekeys=FOO", |
| 427 "domains=DOMAIN.COM|FOO.COM" |
| 428 ]); |
| 429 compareFilter(test, Filter.stripJunk(" @@bl a$foo= bar ,domain
= ab cd "), [ |
| 430 "type=invalid", |
| 431 "text=@@bla$invalid=foo,domain=abcd", |
| 432 "reason=filter_unknown_option" |
| 433 ]); |
| 434 |
| 435 test.done(); |
| 436 }; |
OLD | NEW |