| <style> |
| body { background: white; } |
| video, canvas { background: pink; } |
| </style> |
| <script> |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| |
| function startTest() { |
| var video = document.querySelector('video'); |
| |
| video.onplaying = function() { |
| if (video.currentTime == 0) { |
| setTimeout(video.onplaying, 150); |
| return; |
| } |
| |
| var canvas = document.querySelector('canvas'); |
| var ctx = canvas.getContext('2d'); |
| |
| // This will squish the video a bit, but it doesn't matter for this test. |
| ctx.clearRect(0, 0, canvas.width, canvas.height); |
| ctx.drawImage(video, 0, 0, canvas.width, canvas.height); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| |
| video.play(); |
| } |
| </script> |
| <body onload="startTest();"> |
| <video src="resources/white-square-vp9a.webm" width="320" height="240"></video> |
| <canvas width="320" height="240"></canvas> |
| </body> |