| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| @font-face { |
| font-family: "WebFont"; |
| src: url("../../resources/Ahem.ttf") format("truetype"); |
| } |
| </style> |
| </head> |
| <body> |
| This test makes sure that drawing small caps text into a canvas does not hang the GPU process. This test passes if the test does not time out. |
| <div><canvas id="canvas" width="200" height="200"></canvas></div> |
| <script> |
| if (window.testRunner) { |
| testRunner.waitUntilDone(); |
| testRunner.dumpAsText(); |
| } |
| let canvas = document.getElementById("canvas"); |
| let context = canvas.getContext("2d"); |
| context.font = "small-caps 40px 'WebFont'"; |
| var count = 0; |
| function frame() { |
| if (count == 12) { |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } else { |
| context.fillText("hi", 0, 200); |
| ++count; |
| requestAnimationFrame(frame); |
| } |
| } |
| document.fonts.entries().next().value.load().then(function() { |
| requestAnimationFrame(frame); |
| }); |
| </script> |
| </body> |
| </html> |