OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <script src = "../../resources/js-test.js"></ script> | |
3 <script type = 'text/javascript'> | |
4 if (window.testRunner) | |
5 testRunner.dumpAsText(); | |
6 | |
7 canvas = document.createElement("canvas"); | |
Justin Novosad
2015/08/13 21:03:40
var canvas
xlai (Olivia)
2015/08/20 19:46:43
Done for this and elsewhere.
| |
8 var ctx = canvas.getContext("2d"); | |
9 ctx.fillStyle = "#FF0000"; | |
10 ctx.fillRect(0, 0, 150, 75); | |
11 | |
12 canvas.toBlob(function(blob) { | |
13 var newImg = document.createElement("img"), | |
Justin Novosad
2015/08/13 21:03:40
, -> ;
| |
14 url = URL.createObjectURL(blob); | |
Justin Novosad
2015/08/13 21:03:39
indentation
| |
15 newImg.onload = function() | |
16 { | |
17 // no longer need to read the blob so it's revoked | |
18 URL.revokeObjectURL(url); | |
Justin Novosad
2015/08/13 21:03:40
This will not be called because the test finishes
| |
19 }; | |
20 newImg.src = url; | |
21 document.body.appendChild(newImg); | |
22 }); | |
23 | |
24 function tryGetImageTag() | |
25 { | |
26 var tags = document.getElementsByTagName('img'); | |
Justin Novosad
2015/08/13 21:03:40
you should just make newImg global and use it dire
| |
27 if (typeof tags == = "undefined") | |
28 return ""; | |
29 else if (typeof tags[0] == = "undefined") | |
30 return ""; | |
31 else | |
32 return tags[0].src.substring(0, 9); | |
33 } | |
34 | |
35 shouldBecomeEqual("tryGetImageTag()", "'blob:null'", function(){}, 1000); | |
Justin Novosad
2015/08/13 21:03:40
Can you explain what exactly this tests, why is th
| |
36 | |
37 if (window.testRunner) | |
38 testRunner.notifyDone(); | |
Justin Novosad
2015/08/13 21:03:39
This belongs in the shouldBecomeEqual completion h
xlai (Olivia)
2015/08/20 19:46:43
Deleted this. Changed the shouldBecomeEqual to sho
| |
39 </script> | |
OLD | NEW |