Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <title>Canvas test: filling a pattern with an empty image should not crash.</tit le> | 2 <title>Canvas test: filling a pattern with an empty image should not crash and s hould return a null pattern.</title> |
| 3 <div id="console"></div> | |
| 3 <canvas id="canvas" class="output" width="100" height="100"><p class="fallback"> FAIL (fallback content)</p></canvas> | 4 <canvas id="canvas" class="output" width="100" height="100"><p class="fallback"> FAIL (fallback content)</p></canvas> |
| 4 <script> | 5 <script> |
| 5 if (window.testRunner) | 6 if (window.testRunner) |
| 6 testRunner.dumpAsTextWithPixelResults(); | 7 testRunner.dumpAsText(); |
|
Stephen White
2014/02/27 18:53:41
Bonus points for turning this into a text test.
| |
| 7 | 8 |
| 8 var canvas = document.getElementById("canvas").getContext("2d"); | 9 var canvas = document.getElementById("canvas").getContext("2d"); |
| 9 canvas.fillStyle = canvas.createPattern(new Image, "repeat") | 10 var pattern = canvas.createPattern(new Image, "repeat") |
| 10 canvas.fillRect(0,0,1,1) | 11 if (pattern) |
| 12 document.getElementById("console").innerHTML = "TEST FAILED"; | |
| 13 else | |
| 14 document.getElementById("console").innerHTML = "TEST PASSED"; | |
| 11 </script> | 15 </script> |
| OLD | NEW |