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

Side by Side Diff: chrome/content/tests/regexpFilters_matching.js

Issue 29333048: Issue 3452 - Bring back $ping type option (test changes) (Closed)
Patch Set: Created Dec. 23, 2015, 1:05 p.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 | « chrome/content/tests/policy.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 (function() 1 (function()
2 { 2 {
3 module("Matching of blocking filters", {setup: prepareFilterComponents, teardo wn: restoreFilterComponents}); 3 module("Matching of blocking filters", {setup: prepareFilterComponents, teardo wn: restoreFilterComponents});
4 4
5 function testMatch(text, location, contentType, docDomain, thirdParty, sitekey , expected) 5 function testMatch(text, location, contentType, docDomain, thirdParty, sitekey , expected)
6 { 6 {
7 function testMatch_internal(text, location, contentType, docDomain, thirdPar ty, sitekey, expected) 7 function testMatch_internal(text, location, contentType, docDomain, thirdPar ty, sitekey, expected)
8 { 8 {
9 let filter = Filter.fromText(text); 9 let filter = Filter.fromText(text);
10 let result = filter.matches(location, RegExpFilter.typeMap[contentType], d ocDomain, thirdParty, sitekey); 10 let result = filter.matches(location, RegExpFilter.typeMap[contentType], d ocDomain, thirdParty, sitekey);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 testMatch("abc$~dtd", "http://abc/adf", "DTD", null, false, null, false); 114 testMatch("abc$~dtd", "http://abc/adf", "DTD", null, false, null, false);
115 115
116 testMatch("abc$media", "http://abc/adf", "IMAGE", null, false, null, false); 116 testMatch("abc$media", "http://abc/adf", "IMAGE", null, false, null, false);
117 testMatch("abc$media", "http://abc/adf", "MEDIA", null, false, null, true); 117 testMatch("abc$media", "http://abc/adf", "MEDIA", null, false, null, true);
118 testMatch("abc$~media", "http://abc/adf", "MEDIA", null, false, null, false) ; 118 testMatch("abc$~media", "http://abc/adf", "MEDIA", null, false, null, false) ;
119 119
120 testMatch("abc$font", "http://abc/adf", "IMAGE", null, false, null, false); 120 testMatch("abc$font", "http://abc/adf", "IMAGE", null, false, null, false);
121 testMatch("abc$font", "http://abc/adf", "FONT", null, false, null, true); 121 testMatch("abc$font", "http://abc/adf", "FONT", null, false, null, true);
122 testMatch("abc$~font", "http://abc/adf", "FONT", null, false, null, false); 122 testMatch("abc$~font", "http://abc/adf", "FONT", null, false, null, false);
123 123
124 testMatch("abc$ping", "http://abc/adf", "IMAGE", null, false, null, false);
125 testMatch("abc$ping", "http://abc/adf", "PING", null, false, null, true);
126 testMatch("abc$~ping", "http://abc/adf", "PING", null, false, null, false);
127
124 testMatch("abc$image,script", "http://abc/adf", "IMAGE", null, false, null, true); 128 testMatch("abc$image,script", "http://abc/adf", "IMAGE", null, false, null, true);
125 testMatch("abc$~image", "http://abc/adf", "IMAGE", null, false, null, false) ; 129 testMatch("abc$~image", "http://abc/adf", "IMAGE", null, false, null, false) ;
126 testMatch("abc$~script", "http://abc/adf", "IMAGE", null, false, null, true) ; 130 testMatch("abc$~script", "http://abc/adf", "IMAGE", null, false, null, true) ;
127 testMatch("abc$~image,~script", "http://abc/adf", "IMAGE", null, false, null , false); 131 testMatch("abc$~image,~script", "http://abc/adf", "IMAGE", null, false, null , false);
128 testMatch("abc$~script,~image", "http://abc/adf", "IMAGE", null, false, null , false); 132 testMatch("abc$~script,~image", "http://abc/adf", "IMAGE", null, false, null , false);
129 testMatch("abc$~document,~script,~other", "http://abc/adf", "IMAGE", null, f alse, null, true); 133 testMatch("abc$~document,~script,~other", "http://abc/adf", "IMAGE", null, f alse, null, true);
130 testMatch("abc$~image,image", "http://abc/adf", "IMAGE", null, false, null, true); 134 testMatch("abc$~image,image", "http://abc/adf", "IMAGE", null, false, null, true);
131 testMatch("abc$image,~image", "http://abc/adf", "IMAGE", null, false, null, false); 135 testMatch("abc$image,~image", "http://abc/adf", "IMAGE", null, false, null, false);
132 testMatch("abc$~image,image", "http://abc/adf", "SCRIPT", null, false, null, true); 136 testMatch("abc$~image,image", "http://abc/adf", "SCRIPT", null, false, null, true);
133 testMatch("abc$image,~image", "http://abc/adf", "SCRIPT", null, false, null, false); 137 testMatch("abc$image,~image", "http://abc/adf", "SCRIPT", null, false, null, false);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 testMatch("@@test$~image,document", "http://test/", "DOCUMENT", null, false, null, true); 305 testMatch("@@test$~image,document", "http://test/", "DOCUMENT", null, false, null, true);
302 testMatch("@@test$document,~image", "http://test/", "DOCUMENT", null, false, null, true); 306 testMatch("@@test$document,~image", "http://test/", "DOCUMENT", null, false, null, true);
303 testMatch("@@test$document,domain=foo.com", "http://test/", "DOCUMENT", "foo .com", false, null, true); 307 testMatch("@@test$document,domain=foo.com", "http://test/", "DOCUMENT", "foo .com", false, null, true);
304 testMatch("@@test$document,domain=foo.com", "http://test/", "DOCUMENT", "bar .com", false, null, false); 308 testMatch("@@test$document,domain=foo.com", "http://test/", "DOCUMENT", "bar .com", false, null, false);
305 testMatch("@@test$document,domain=~foo.com", "http://test/", "DOCUMENT", "fo o.com", false, null, false); 309 testMatch("@@test$document,domain=~foo.com", "http://test/", "DOCUMENT", "fo o.com", false, null, false);
306 testMatch("@@test$document,domain=~foo.com", "http://test/", "DOCUMENT", "ba r.com", false, null, true); 310 testMatch("@@test$document,domain=~foo.com", "http://test/", "DOCUMENT", "ba r.com", false, null, true);
307 testMatch("@@test$document,sitekey=foo-publickey", "http://test/", "DOCUMENT ", "foo.com", false, "foo-publickey", true); 311 testMatch("@@test$document,sitekey=foo-publickey", "http://test/", "DOCUMENT ", "foo.com", false, "foo-publickey", true);
308 testMatch("@@test$document,sitekey=foo-publickey", "http://test/", "DOCUMENT ", "foo.com", false, null, false); 312 testMatch("@@test$document,sitekey=foo-publickey", "http://test/", "DOCUMENT ", "foo.com", false, null, false);
309 }); 313 });
310 })(); 314 })();
OLDNEW
« no previous file with comments | « chrome/content/tests/policy.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld