Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <img id="myImg" onload="testDone()"> | |
| 2 <script src = "../../resources/js-test.js"></script> | |
|
xlai (Olivia)
2015/08/21 18:40:05
Using asynchronous testing from js-test testing fr
| |
| 3 <script type = 'text/javascript'> | |
| 4 if (window.testRunner) { | |
| 5 testRunner.dumpAsTextWithPixelResults(); | |
|
Justin Novosad
2015/08/21 18:53:43
This should not be a pixel test. We only use pixel
| |
| 6 testRunner.waitUntilDone(); | |
| 7 } | |
| 8 | |
| 9 function testDone() { | |
| 10 if (window.testRunner) | |
| 11 testRunner.notifyDone(); | |
| 12 } | |
| 13 | |
| 14 var newImg = document.getElementById("myImg"); | |
| 15 var canvas = document.createElement("canvas"); | |
| 16 var ctx = canvas.getContext("2d"); | |
| 17 ctx.fillStyle = "#FF0000"; | |
| 18 ctx.fillRect(0, 0, 150, 75); | |
| 19 | |
| 20 canvas.toBlob(function(blob) { | |
| 21 url = URL.createObjectURL(blob); | |
| 22 newImg.src = url; | |
| 23 }); | |
| 24 </script> | |
| 25 </head> | |
| 26 </body> | |
| 27 </html> | |
| OLD | NEW |