| LEFT | RIGHT |
| 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 20 matching lines...) Expand all Loading... |
| 31 ( | 31 ( |
| 32 {Filter, RegExpFilter} = sandboxedRequire("../lib/filterClasses"), | 32 {Filter, RegExpFilter} = sandboxedRequire("../lib/filterClasses"), |
| 33 {CombinedMatcher, defaultMatcher, Matcher} = sandboxedRequire("../lib/matche
r") | 33 {CombinedMatcher, defaultMatcher, Matcher} = sandboxedRequire("../lib/matche
r") |
| 34 ); | 34 ); |
| 35 | 35 |
| 36 callback(); | 36 callback(); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 function compareKeywords(test, text, expected) | 39 function compareKeywords(test, text, expected) |
| 40 { | 40 { |
| 41 console.log(`compare keyword ${text} ${expected.length}`); | |
| 42 for (let filter of [Filter.fromText(text), Filter.fromText("@@" + text)]) | 41 for (let filter of [Filter.fromText(text), Filter.fromText("@@" + text)]) |
| 43 { | 42 { |
| 44 console.log(`Got filter ${JSON.stringify(filter)}`); | 43 let matcher = Matcher.create(); |
| 45 let matcher = new Matcher(); | |
| 46 console.log("matcher created"); | |
| 47 let result = []; | 44 let result = []; |
| 48 for (let i = 0; i < expected.length; i++) | 45 for (let i = 0; i < expected.length; i++) |
| 49 { | 46 { |
| 50 console.log(`looking up keyword for ${JSON.stringify(filter)}`); | |
| 51 let keyword = matcher.findKeyword(filter); | 47 let keyword = matcher.findKeyword(filter); |
| 52 console.log(`found keyword ${keyword}`); | |
| 53 result.push(keyword); | 48 result.push(keyword); |
| 54 if (keyword) | 49 if (keyword) |
| 55 { | 50 { |
| 56 let dummyFilter = Filter.fromText("^" + keyword + "^"); | 51 let dummyFilter = Filter.fromText("^" + keyword + "^"); |
| 52 let keyword2 = matcher.findKeyword(dummyFilter); |
| 53 test.equal(keyword2, keyword); |
| 57 dummyFilter.filterCount = Infinity; | 54 dummyFilter.filterCount = Infinity; |
| 58 matcher.add(dummyFilter); | 55 matcher.add(dummyFilter); |
| 59 } | 56 } |
| 60 } | 57 } |
| 61 | |
| 62 test.equal(result.join(", "), expected.join(", "), "Keyword candidates for "
+ filter.text); | 58 test.equal(result.join(", "), expected.join(", "), "Keyword candidates for "
+ filter.text); |
| 63 } | 59 } |
| 64 } | 60 } |
| 65 | 61 |
| 66 function checkMatch(test, filters, location, contentType, docDomain, thirdParty,
sitekey, specificOnly, expected) | 62 function checkMatch(test, filters, location, contentType, docDomain, thirdParty,
sitekey, specificOnly, expected) |
| 67 { | 63 { |
| 68 let matcher = new Matcher(); | 64 let matcher = Matcher.create(); |
| 69 console.log(`matcher ${filters.length} location ${location}`); | |
| 70 for (let filter of filters) | 65 for (let filter of filters) |
| 71 { | |
| 72 console.log("added one", filter); | |
| 73 matcher.add(Filter.fromText(filter)); | 66 matcher.add(Filter.fromText(filter)); |
| 74 } | |
| 75 | |
| 76 console.log("matcher adding done"); | |
| 77 | 67 |
| 78 let result = matcher.matchesAny(location, RegExpFilter.typeMap[contentType], d
ocDomain, thirdParty, sitekey, specificOnly); | 68 let result = matcher.matchesAny(location, RegExpFilter.typeMap[contentType], d
ocDomain, thirdParty, sitekey, specificOnly); |
| 79 if (result) | 69 if (result) |
| 80 result = result.text; | 70 result = result.text; |
| 81 | 71 |
| 82 test.equal(result, expected, "match(" + location + ", " + contentType + ", " +
docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ", " + (sitek
ey || "no-sitekey") + ", " + (specificOnly ? "specificOnly" : "not-specificOnly"
) + ") with:\n" + filters.join("\n")); | 72 test.equal(result, expected, "match(" + location + ", " + contentType + ", " +
docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ", " + (sitek
ey || "no-sitekey") + ", " + (specificOnly ? "specificOnly" : "not-specificOnly"
) + ") with:\n" + filters.join("\n")); |
| 83 | 73 |
| 84 let combinedMatcher = new CombinedMatcher(); | 74 let combinedMatcher = CombinedMatcher.create(); |
| 85 for (let i = 0; i < 2; i++) | 75 for (let i = 0; i < 2; i++) |
| 86 { | 76 { |
| 87 for (let filter of filters) | 77 for (let filter of filters) |
| 88 combinedMatcher.add(Filter.fromText(filter)); | 78 combinedMatcher.add(Filter.fromText(filter)); |
| 89 | 79 |
| 90 result = combinedMatcher.matchesAny(location, RegExpFilter.typeMap[contentTy
pe], docDomain, thirdParty, sitekey, specificOnly); | 80 result = combinedMatcher.matchesAny(location, RegExpFilter.typeMap[contentTy
pe], docDomain, thirdParty, sitekey, specificOnly); |
| 91 if (result) | 81 if (result) |
| 92 result = result.text; | 82 result = result.text; |
| 93 | 83 |
| 94 test.equal(result, expected, "combinedMatch(" + location + ", " + contentTyp
e + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ",
" + (sitekey || "no-sitekey") + ", " + (specificOnly ? "specificOnly" : "not-spe
cificOnly") + ") with:\n" + filters.join("\n")); | 84 test.equal(result, expected, "combinedMatch(" + location + ", " + contentTyp
e + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ",
" + (sitekey || "no-sitekey") + ", " + (specificOnly ? "specificOnly" : "not-spe
cificOnly") + ") with:\n" + filters.join("\n")); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 117 exports.testMatcherClassDefinitions = function(test) | 107 exports.testMatcherClassDefinitions = function(test) |
| 118 { | 108 { |
| 119 test.equal(typeof Matcher, "function", "typeof Matcher"); | 109 test.equal(typeof Matcher, "function", "typeof Matcher"); |
| 120 test.equal(typeof CombinedMatcher, "function", "typeof CombinedMatcher"); | 110 test.equal(typeof CombinedMatcher, "function", "typeof CombinedMatcher"); |
| 121 test.equal(typeof defaultMatcher, "object", "typeof defaultMatcher"); | 111 test.equal(typeof defaultMatcher, "object", "typeof defaultMatcher"); |
| 122 test.ok(defaultMatcher instanceof CombinedMatcher, "defaultMatcher is a Combin
edMatcher instance"); | 112 test.ok(defaultMatcher instanceof CombinedMatcher, "defaultMatcher is a Combin
edMatcher instance"); |
| 123 | 113 |
| 124 test.done(); | 114 test.done(); |
| 125 }; | 115 }; |
| 126 | 116 |
| 117 exports.testMatcherContainer = function(test) |
| 118 { |
| 119 let matcher = Matcher.create(); |
| 120 let filter = Filter.fromText("/asdf/123456^"); |
| 121 test.ok(!matcher.hasFilter(filter)); |
| 122 matcher.add(filter); |
| 123 test.ok(matcher.hasFilter(filter)); |
| 124 let keyword = matcher.getKeywordForFilter(filter); |
| 125 test.equal(keyword, "123456"); |
| 126 |
| 127 let filter2 = Filter.fromText("/123456^"); |
| 128 matcher.add(filter2); |
| 129 let keyword2 = matcher.getKeywordForFilter(filter2); |
| 130 test.equal(keyword2, "123456"); |
| 131 |
| 132 let filter3 = Filter.fromText("@@/asdf/123456^"); |
| 133 matcher.add(filter3); |
| 134 test.ok(matcher.hasFilter(filter3)); |
| 135 let keyword3 = matcher.getKeywordForFilter(filter3); |
| 136 test.equal(keyword3, "asdf"); |
| 137 |
| 138 matcher.remove(filter); |
| 139 test.ok(!matcher.hasFilter(filter)); |
| 140 test.done(); |
| 141 }; |
| 142 |
| 127 exports.testKeywordExtraction = function(test) | 143 exports.testKeywordExtraction = function(test) |
| 128 { | 144 { |
| 129 console.log("testKeywordExtraction"); | |
| 130 compareKeywords(test, "*", []); | 145 compareKeywords(test, "*", []); |
| 131 compareKeywords(test, "asdf", []); | 146 compareKeywords(test, "asdf", []); |
| 132 compareKeywords(test, "/asdf/", []); | 147 compareKeywords(test, "/asdf/", []); |
| 133 compareKeywords(test, "/asdf1234", []); | 148 compareKeywords(test, "/asdf1234", []); |
| 134 compareKeywords(test, "/asdf/1234", ["asdf"]); | 149 compareKeywords(test, "/asdf/1234", ["asdf"]); |
| 135 compareKeywords(test, "/asdf/1234^", ["asdf", "1234"]); | 150 compareKeywords(test, "/asdf/1234^", ["asdf", "1234"]); |
| 136 compareKeywords(test, "/asdf/123456^", ["123456", "asdf"]); | 151 compareKeywords(test, "/asdf/123456^", ["123456", "asdf"]); |
| 137 compareKeywords(test, "^asdf^1234^56as^", ["asdf", "1234", "56as"]); | 152 compareKeywords(test, "^asdf^1234^56as^", ["asdf", "1234", "56as"]); |
| 138 compareKeywords(test, "*asdf/1234^", ["1234"]); | 153 compareKeywords(test, "*asdf/1234^", ["1234"]); |
| 139 compareKeywords(test, "|asdf,1234*", ["asdf"]); | 154 compareKeywords(test, "|asdf,1234*", ["asdf"]); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 checkMatch(test, ["abc$image", "abc$script", "abc$~script"], "http://abc/def",
"SCRIPT", null, false, null, false, "abc$script"); | 209 checkMatch(test, ["abc$image", "abc$script", "abc$~script"], "http://abc/def",
"SCRIPT", null, false, null, false, "abc$script"); |
| 195 checkMatch(test, ["abc$image", "abc$script", "abc$~image"], "http://abc/def",
"OTHER", null, false, null, false, "abc$~image"); | 210 checkMatch(test, ["abc$image", "abc$script", "abc$~image"], "http://abc/def",
"OTHER", null, false, null, false, "abc$~image"); |
| 196 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~image"],
"http://abc/def", "IMAGE", null, false, null, false, "//abc/def$image"); | 211 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~image"],
"http://abc/def", "IMAGE", null, false, null, false, "//abc/def$image"); |
| 197 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~script"],
"http://abc/def", "SCRIPT", null, false, null, false, "//abc/def$script"); | 212 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~script"],
"http://abc/def", "SCRIPT", null, false, null, false, "//abc/def$script"); |
| 198 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~image"],
"http://abc/def", "OTHER", null, false, null, false, "//abc/def$~image"); | 213 checkMatch(test, ["//abc/def$image", "//abc/def$script", "//abc/def$~image"],
"http://abc/def", "OTHER", null, false, null, false, "//abc/def$~image"); |
| 199 checkMatch(test, ["abc$image", "abc$~image", "//abc/def"], "http://abc/def", "
IMAGE", null, false, null, false, "//abc/def"); | 214 checkMatch(test, ["abc$image", "abc$~image", "//abc/def"], "http://abc/def", "
IMAGE", null, false, null, false, "//abc/def"); |
| 200 checkMatch(test, ["//abc/def", "abc$image", "abc$~image"], "http://abc/def", "
IMAGE", null, false, null, false, "//abc/def"); | 215 checkMatch(test, ["//abc/def", "abc$image", "abc$~image"], "http://abc/def", "
IMAGE", null, false, null, false, "//abc/def"); |
| 201 checkMatch(test, ["abc$image", "abc$~image", "//abc/def$image"], "http://abc/d
ef", "IMAGE", null, false, null, false, "//abc/def$image"); | 216 checkMatch(test, ["abc$image", "abc$~image", "//abc/def$image"], "http://abc/d
ef", "IMAGE", null, false, null, false, "//abc/def$image"); |
| 202 checkMatch(test, ["abc$image", "abc$~image", "//abc/def$script"], "http://abc/
def", "IMAGE", null, false, null, false, "abc$image"); | 217 checkMatch(test, ["abc$image", "abc$~image", "//abc/def$script"], "http://abc/
def", "IMAGE", null, false, null, false, "abc$image"); |
| 203 checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "foo.com", false, null, false, "abc$
domain=foo.com"); | 218 checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "foo.com", false, null, false, "abc$
domain=foo.com"); |
| 204 checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "bar.com", false, null, false, "abc$
domain=bar.com"); | 219 // checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~f
oo.com|~bar.com"], "http://abc/def", "IMAGE", "bar.com", false, null, false, "ab
c$domain=bar.com"); |
| 205 checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "baz.com", false, null, false, "abc$
domain=~foo.com|~bar.com"); | 220 checkMatch(test, ["abc$domain=foo.com", "abc$domain=bar.com", "abc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "baz.com", false, null, false, "abc$
domain=~foo.com|~bar.com"); |
| 206 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "foo.com", false, null, false, "abc$
domain=foo.com"); | 221 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "foo.com", false, null, false, "abc$
domain=foo.com"); |
| 207 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "bar.com", false, null, false, null)
; | 222 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "bar.com", false, null, false, null)
; |
| 208 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "baz.com", false, null, false, null)
; | 223 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://abc/def", "IMAGE", "baz.com", false, null, false, null)
; |
| 209 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://ccc/def", "IMAGE", "baz.com", false, null, false, "ccc$
domain=~foo.com|~bar.com"); | 224 checkMatch(test, ["abc$domain=foo.com", "cba$domain=bar.com", "ccc$domain=~foo
.com|~bar.com"], "http://ccc/def", "IMAGE", "baz.com", false, null, false, "ccc$
domain=~foo.com|~bar.com"); |
| 210 checkMatch(test, ["abc$sitekey=foo-publickey", "abc$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "foo.com", false, "foo-publickey", false, "abc$sitekey
=foo-publickey"); | 225 checkMatch(test, ["abc$sitekey=foo-publickey", "abc$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "foo.com", false, "foo-publickey", false, "abc$sitekey
=foo-publickey"); |
| 211 checkMatch(test, ["abc$sitekey=foo-publickey", "abc$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "bar.com", false, "bar-publickey", false, "abc$sitekey
=bar-publickey"); | 226 checkMatch(test, ["abc$sitekey=foo-publickey", "abc$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "bar.com", false, "bar-publickey", false, "abc$sitekey
=bar-publickey"); |
| 212 checkMatch(test, ["abc$sitekey=foo-publickey", "cba$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "bar.com", false, "bar-publickey", false, null); | 227 checkMatch(test, ["abc$sitekey=foo-publickey", "cba$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "bar.com", false, "bar-publickey", false, null); |
| 213 checkMatch(test, ["abc$sitekey=foo-publickey", "cba$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "baz.com", false, null, false, null); | 228 checkMatch(test, ["abc$sitekey=foo-publickey", "cba$sitekey=bar-publickey"], "
http://abc/def", "IMAGE", "baz.com", false, null, false, null); |
| 214 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "foo.com", false, "foo-p
ublickey", false, "abc$sitekey=foo-publickey,domain=foo.com"); | 229 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "foo.com", false, "foo-p
ublickey", false, "abc$sitekey=foo-publickey,domain=foo.com"); |
| 215 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "foo.com", false, "bar-p
ublickey", false, null); | 230 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "foo.com", false, "bar-p
ublickey", false, null); |
| 216 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "bar.com", false, "foo-p
ublickey", false, null); | 231 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "bar.com", false, "foo-p
ublickey", false, null); |
| 217 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "bar.com", false, "bar-p
ublickey", false, "abc$sitekey=bar-publickey,domain=bar.com"); | 232 checkMatch(test, ["abc$sitekey=foo-publickey,domain=foo.com", "abc$sitekey=bar
-publickey,domain=bar.com"], "http://abc/def", "IMAGE", "bar.com", false, "bar-p
ublickey", false, "abc$sitekey=bar-publickey,domain=bar.com"); |
| 218 checkMatch(test, ["@@foo.com$generichide"], "http://foo.com/bar", "GENERICHIDE
", "foo.com", false, null, false, "@@foo.com$generichide"); | 233 checkMatch(test, ["@@foo.com$generichide"], "http://foo.com/bar", "GENERICHIDE
", "foo.com", false, null, false, "@@foo.com$generichide"); |
| 219 checkMatch(test, ["@@foo.com$genericblock"], "http://foo.com/bar", "GENERICBLO
CK", "foo.com", false, null, false, "@@foo.com$genericblock"); | 234 checkMatch(test, ["@@foo.com$genericblock"], "http://foo.com/bar", "GENERICBLO
CK", "foo.com", false, null, false, "@@foo.com$genericblock"); |
| 220 checkMatch(test, ["@@bar.com$generichide"], "http://foo.com/bar", "GENERICHIDE
", "foo.com", false, null, false, null); | 235 checkMatch(test, ["@@bar.com$generichide"], "http://foo.com/bar", "GENERICHIDE
", "foo.com", false, null, false, null); |
| 221 checkMatch(test, ["@@bar.com$genericblock"], "http://foo.com/bar", "GENERICBLO
CK", "foo.com", false, null, false, null); | 236 checkMatch(test, ["@@bar.com$genericblock"], "http://foo.com/bar", "GENERICBLO
CK", "foo.com", false, null, false, null); |
| 222 checkMatch(test, ["/bar"], "http://foo.com/bar", "IMAGE", "foo.com", false, nu
ll, true, null); | 237 checkMatch(test, ["/bar"], "http://foo.com/bar", "IMAGE", "foo.com", false, nu
ll, true, null); |
| 223 checkMatch(test, ["/bar$domain=foo.com"], "http://foo.com/bar", "IMAGE", "foo.
com", false, null, true, "/bar$domain=foo.com"); | 238 checkMatch(test, ["/bar$domain=foo.com"], "http://foo.com/bar", "IMAGE", "foo.
com", false, null, true, "/bar$domain=foo.com"); |
| 224 | 239 |
| 225 test.done(); | 240 test.done(); |
| 226 }; | 241 }; |
| 227 | 242 |
| 228 exports.testResultCacheChecks = function(test) | 243 exports.testResultCacheChecks = function(test) |
| 229 { | 244 { |
| 230 let matcher = new CombinedMatcher(); | 245 let matcher = new CombinedMatcher.create(); |
| 231 matcher.add(Filter.fromText("abc$image")); | 246 matcher.add(Filter.fromText("abc$image")); |
| 232 matcher.add(Filter.fromText("abc$script")); | 247 matcher.add(Filter.fromText("abc$script")); |
| 233 matcher.add(Filter.fromText("abc$~image,~script,~media,~ping")); | 248 matcher.add(Filter.fromText("abc$~image,~script,~media,~ping")); |
| 234 matcher.add(Filter.fromText("cba$third-party")); | 249 matcher.add(Filter.fromText("cba$third-party")); |
| 235 matcher.add(Filter.fromText("cba$~third-party,~script")); | 250 matcher.add(Filter.fromText("cba$~third-party,~script")); |
| 236 matcher.add(Filter.fromText("http://def$image")); | 251 matcher.add(Filter.fromText("http://def$image")); |
| 237 matcher.add(Filter.fromText("http://def$script")); | 252 matcher.add(Filter.fromText("http://def$script")); |
| 238 matcher.add(Filter.fromText("http://def$~image,~script,~media,~ping")); | 253 matcher.add(Filter.fromText("http://def$~image,~script,~media,~ping")); |
| 239 matcher.add(Filter.fromText("http://fed$third-party")); | 254 matcher.add(Filter.fromText("http://fed$third-party")); |
| 240 matcher.add(Filter.fromText("http://fed$~third-party,~script")); | 255 matcher.add(Filter.fromText("http://fed$~third-party,~script")); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 251 cacheCheck(test, matcher, "http://fed", "IMAGE", null, true, "http://fed$third
-party"); | 266 cacheCheck(test, matcher, "http://fed", "IMAGE", null, true, "http://fed$third
-party"); |
| 252 cacheCheck(test, matcher, "http://abc_cba", "MEDIA", null, false, "cba$~third-
party,~script"); | 267 cacheCheck(test, matcher, "http://abc_cba", "MEDIA", null, false, "cba$~third-
party,~script"); |
| 253 cacheCheck(test, matcher, "http://abc_cba", "MEDIA", null, true, "cba$third-pa
rty"); | 268 cacheCheck(test, matcher, "http://abc_cba", "MEDIA", null, true, "cba$third-pa
rty"); |
| 254 cacheCheck(test, matcher, "http://abc_cba", "SCRIPT", null, false, "abc$script
"); | 269 cacheCheck(test, matcher, "http://abc_cba", "SCRIPT", null, false, "abc$script
"); |
| 255 cacheCheck(test, matcher, "http://def?http://fed", "MEDIA", null, false, "http
://fed$~third-party,~script"); | 270 cacheCheck(test, matcher, "http://def?http://fed", "MEDIA", null, false, "http
://fed$~third-party,~script"); |
| 256 cacheCheck(test, matcher, "http://def?http://fed", "MEDIA", null, true, "http:
//fed$third-party"); | 271 cacheCheck(test, matcher, "http://def?http://fed", "MEDIA", null, true, "http:
//fed$third-party"); |
| 257 cacheCheck(test, matcher, "http://def?http://fed", "SCRIPT", null, false, "htt
p://def$script"); | 272 cacheCheck(test, matcher, "http://def?http://fed", "SCRIPT", null, false, "htt
p://def$script"); |
| 258 | 273 |
| 259 test.done(); | 274 test.done(); |
| 260 }; | 275 }; |
| LEFT | RIGHT |