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

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

Issue 29333123: Issue 3459 - Make content policy test for fetch() explicitly dispatch abp:frameready (Closed)
Patch Set: Created Dec. 30, 2015, 3:40 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 | « no previous file | 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 let server = null; 3 let server = null;
4 let frame = null; 4 let frame = null;
5 let requestNotifier = null; 5 let requestNotifier = null;
6 let httpProtocol = null; 6 let httpProtocol = null;
7 7
8 module("Content policy", { 8 module("Content policy", {
9 setup: function() 9 setup: function()
10 { 10 {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 "HTML object (Java)", 287 "HTML object (Java)",
288 '<object type="application/x-java-applet" data="test.class"></object>', 288 '<object type="application/x-java-applet" data="test.class"></object>',
289 "http://127.0.0.1:1234/test.class", "object", false, false 289 "http://127.0.0.1:1234/test.class", "object", false, false
290 ]); 290 ]);
291 } 291 }
292 292
293 if ("fetch" in window) 293 if ("fetch" in window)
294 { 294 {
295 tests.push([ 295 tests.push([
296 "fetch() API", 296 "fetch() API",
297 '<script>fetch("test.xml").catch(function() {});</script>', 297 '<script>' +
298 'fetch("test.xml").then(' +
299 'function()' +
300 '{' +
301 dispatchReadyEvent +
302 '},' +
303 'function()' +
304 '{' +
305 dispatchReadyEvent +
306 '}' +
307 ');' +
308 '</script>',
298 "http://127.0.0.1:1234/test.xml", "xmlhttprequest", false, false 309 "http://127.0.0.1:1234/test.xml", "xmlhttprequest", false, false
Wladimir Palant 2015/12/31 13:38:45 Last value should be true here, not false (explici
Sebastian Noack 2015/12/31 14:36:39 Done.
299 ]); 310 ]);
300 } 311 }
301 312
302 let policyHits = []; 313 let policyHits = [];
303 function onPolicyHit(item, scanComplete) 314 function onPolicyHit(item, scanComplete)
304 { 315 {
305 if (!item) 316 if (!item)
306 return; 317 return;
307 if (item.location == "http://127.0.0.1:1234/test" || 318 if (item.location == "http://127.0.0.1:1234/test" ||
308 item.location == "http://127.0.0.1:1234/redirect.gif" || 319 item.location == "http://127.0.0.1:1234/redirect.gif" ||
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 for (let stage = 1; stage in stageDescriptions; stage++) 469 for (let stage = 1; stage in stageDescriptions; stage++)
459 { 470 {
460 let stageDescription = stageDescriptions[stage]; 471 let stageDescription = stageDescriptions[stage];
461 if (stageDescription.indexOf("%S") >= 0) 472 if (stageDescription.indexOf("%S") >= 0)
462 stageDescription = stageDescription.replace("%S", expectedURL); 473 stageDescription = stageDescription.replace("%S", expectedURL);
463 474
464 asyncTest(name + " (" + stageDescription + ")", runTest.bind(null, tests[t est], stage)); 475 asyncTest(name + " (" + stageDescription + ")", runTest.bind(null, tests[t est], stage));
465 } 476 }
466 } 477 }
467 })(); 478 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld