OLD | NEW |
1 <html> | 1 <script src="../../resources/testharness.js"></script> |
2 <head> | 2 <script src="../../resources/testharnessreport.js"></script> |
3 <script type="text/javascript"> | |
4 if (window.testRunner) | |
5 testRunner.dumpAsText(); | |
6 | 3 |
7 function init() | 4 <script> |
8 { | 5 function runTest() |
9 var ctx = document.getElementById("canvas").getContext("2d"); | 6 { |
10 ctx.font = "font-family: Helvetica; font-size: 48pt; font-color: #000000
"; | 7 var ctx = document.createElement("canvas").getContext("2d"); |
11 ctx.fillText("Hello world", 10, 200); | 8 ctx.font = "font-family: Helvetica; font-size: 48pt; font-color: #000000"; |
| 9 ctx.fillText("Hello world", 10, 200); |
| 10 } |
| 11 |
| 12 async_test(t => { |
| 13 window.onload = function() { |
| 14 t.step(runTest); |
| 15 t.done(); |
12 } | 16 } |
13 </script> | 17 }, 'Verify that setting the font does not crash.'); |
14 </head> | 18 </script> |
15 <body onload="init()"> | |
16 <p>This test should not crash.</p> | |
17 <canvas id="canvas" height="300" width="300"></canvas> | |
18 </body> | |
19 </html> | |
OLD | NEW |