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

Delta Between Two Patch Sets: test/abp2blocklist.js

Issue 29426594: Issue 3673 - Merge closely matching rules (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Left Patch Set: Map async callees asynchronously Created July 28, 2017, 9:07 a.m.
Right Patch Set: Rebase Created July 28, 2017, 1:31 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/abp2blocklist.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
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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 action: {type: "css-display-none", selector: ".whatever"}} 58 action: {type: "css-display-none", selector: ".whatever"}}
59 ]) 59 ])
60 ]); 60 ]);
61 }, 61 },
62 62
63 testElementHidingExceptions: function(test) 63 testElementHidingExceptions: function(test)
64 { 64 {
65 runTest(test, [ 65 runTest(test, [
66 testRules(test, [ 66 testRules(test, [
67 "##.whatever", 67 "##.whatever",
68 "test.com###something", 68 "test.com,anothertest.com###something",
69 "@@||special.test.com^$elemhide", 69 "@@||special.test.com^$elemhide",
70 "@@||test.com^$generichide", 70 "@@||test.com^$generichide",
71 "@@||anothertest.com^$elemhide",
71 "@@^something^$elemhide", 72 "@@^something^$elemhide",
72 "@@^anything^$generichide" 73 "@@^anything^$generichide"
73 ], [ 74 ], [
74 ["^https?://", ["*test.com", "*special.test.com"]], 75 ["^https?://", ["*test.com", "*special.test.com", "*anothertest.com"]],
75 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]] 76 ["^https?://([^/:]*\\.)?test\\.com[/:]", ["*special.test.com"]]
76 ], rules => rules.map(rule => [rule.trigger["url-filter"], 77 ], rules => rules.map(rule => [rule.trigger["url-filter"],
77 rule.trigger["unless-domain"]])), 78 rule.trigger["unless-domain"]])),
78 79
79 testRules(test, ["#@#whatever"], []), 80 testRules(test, ["#@#whatever"], []),
80 testRules(test, ["test.com#@#whatever"], []), 81 testRules(test, ["test.com#@#whatever"], []),
81 testRules(test, ["~test.com#@#whatever"], []), 82 testRules(test, ["~test.com#@#whatever"], []),
82 83
83 // We currently completely ignore any element hiding filters that have the 84 // We currently completely ignore any element hiding filters that have the
84 // same selector as an element hiding exception. In these examples 85 // same selector as an element hiding exception. In these examples
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 {merge: "all"}), 498 {merge: "all"}),
498 499
499 // Redundant rules should be discarded. 500 // Redundant rules should be discarded.
500 testRules(test, ["/ad", "/ads", "/advertisement"], 501 testRules(test, ["/ad", "/ads", "/advertisement"],
501 ["^[^:]+:(//)?.*/ad"], 502 ["^[^:]+:(//)?.*/ad"],
502 rules => rules.map(rule => rule.trigger["url-filter"]), 503 rules => rules.map(rule => rule.trigger["url-filter"]),
503 {merge: "all"}) 504 {merge: "all"})
504 ]); 505 ]);
505 } 506 }
506 }; 507 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld