Chromium Code Reviews| Index: LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html |
| diff --git a/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6b748e923680f054a7afc0b6734f43328dcfba0a |
| --- /dev/null |
| +++ b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html |
| @@ -0,0 +1,27 @@ |
| +<img id="myImg" onload="testDone()"> |
| +<script src = "../../resources/js-test.js"></script> |
|
xlai (Olivia)
2015/08/21 18:40:05
Using asynchronous testing from js-test testing fr
|
| +<script type = 'text/javascript'> |
| +if (window.testRunner) { |
| + testRunner.dumpAsTextWithPixelResults(); |
|
Justin Novosad
2015/08/21 18:53:43
This should not be a pixel test. We only use pixel
|
| + testRunner.waitUntilDone(); |
| +} |
| + |
| +function testDone() { |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| +} |
| + |
| +var newImg = document.getElementById("myImg"); |
| +var canvas = document.createElement("canvas"); |
| +var ctx = canvas.getContext("2d"); |
| +ctx.fillStyle = "#FF0000"; |
| +ctx.fillRect(0, 0, 150, 75); |
| + |
| +canvas.toBlob(function(blob) { |
| + url = URL.createObjectURL(blob); |
| + newImg.src = url; |
| +}); |
| +</script> |
| +</head> |
| +</body> |
| +</html> |