OLD | NEW |
---|---|
1 <style> | 1 <style> |
2 @font-face { | 2 @font-face { |
3 font-family: no-such-font; | 3 font-family: no-such-font; |
4 src: url(no-such-file.ttf); | 4 src: url(no-such-file.ttf); |
5 } | 5 } |
6 </style> | 6 </style> |
7 <canvas id="target"></canvas> | 7 <canvas id="target"></canvas> |
8 <script> | 8 <script> |
9 canvas = document.getElementById("target"); | 9 canvas = document.getElementById("target"); |
10 ctx = canvas.getContext('2d'); | 10 ctx = canvas.getContext('2d'); |
11 ctx.font = "100px no-such-font, ahem"; | 11 ctx.font = "100px no-such-font, ahem"; |
12 ctx.fillStyle = "red"; | 12 ctx.fillStyle = "red"; |
13 ctx.fillText("B", 0, 100); | 13 ctx.fillText("B", 0, 100); |
14 ctx.fillStyle = "green"; | 14 ctx.fillStyle = "green"; |
15 canvas.parentNode.removeChild(canvas); | 15 canvas.parentNode.removeChild(canvas); |
16 if (window.testRunner) { | 16 if (window.testRunner) { |
17 testRunner.dumpAsTextWithPixelResults(); | |
18 testRunner.waitUntilDone(); | 17 testRunner.waitUntilDone(); |
19 } | 18 } |
Stephen White
2014/03/05 21:29:33
Nit: weird formatting (not new to this patch). Cou
| |
20 setTimeout(function() | 19 setTimeout(function() |
21 { | 20 { |
22 ctx.fillText("A", 0, 100); | 21 ctx.fillText("A", 0, 100); |
23 document.body.appendChild(canvas); | 22 document.body.appendChild(canvas); |
24 if (window.testRunner) | 23 if (window.testRunner) |
25 testRunner.notifyDone(); | 24 testRunner.notifyDone(); |
26 }, 50); | 25 }, 50); |
27 </script> | 26 </script> |
OLD | NEW |