OLD | NEW |
1 <!DOCTYPE HTML> | 1 <script src="../../resources/testharness.js"></script> |
2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
3 <head> | |
4 </head> | |
5 <body> | 3 <body> |
6 <canvas id="mycanvas" width="512" height="512"></canvas> | 4 <canvas id="mycanvas" width="512" height="512"></canvas> |
7 <script> | 5 <script> |
8 if (window.testRunner) | 6 function runTest() { |
9 testRunner.dumpAsText() | |
10 onload = function() | |
11 { | |
12 var canvas = document.getElementById('mycanvas'); | 7 var canvas = document.getElementById('mycanvas'); |
13 var ctx = canvas.getContext('2d'); | 8 var ctx = canvas.getContext('2d'); |
14 ctx.fillStyle = "rgb(255,165,0)"; | 9 ctx.fillStyle = "rgb(255,165,0)"; |
15 ctx.fillRect(0, 0, 512, 512); | 10 ctx.fillRect(0, 0, 512, 512); |
16 ctx.save(); | 11 ctx.save(); |
17 canvas.width = 256; | 12 canvas.width = 256; |
18 ctx.fillStyle = "rgb(255,165,0)"; | 13 ctx.fillStyle = "rgb(255,165,0)"; |
19 ctx.fillRect(0, 0, 256, 512); | 14 ctx.fillRect(0, 0, 256, 512); |
20 document.body.appendChild(document.createElement("p")).appendChild(document.
createTextNode("If we got this far without an assertion, this test passed.")); | 15 } |
21 }; | 16 |
| 17 async_test(t => { |
| 18 window.onload = function() { |
| 19 t.step(runTest); |
| 20 t.done(); |
| 21 } |
| 22 }, 'Verify that canvas resize after save does not crash.'); |
22 </script> | 23 </script> |
23 </body> | 24 </body> |
24 </html> | |
OLD | NEW |