Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / canvas-animation-update.html
blob1832490dbf668581bd440dabd9b8724d3023e213
1 <!DOCTYPE html>
2 <html>
3 <body>
4 This test verifies that canvas animations update properly with anuimation loops that use setTimeout. Eight vertical green bars should appear below this text.
5 <canvas id="c" width="400" height="200"></canvas>
6 <script type="text/javascript">
7 var canvas = document.getElementById('c');
8 var ctx = canvas.getContext('2d');
9 ctx.fillStyle = 'green';
10 var xpos = 0;
12 if (window.testRunner) {
13 testRunner.waitUntilDone();
16 function draw() {
17 ctx.fillRect(xpos, 0, 40, 200);
18 xpos = xpos + 50;
19 if (xpos < 400) {
20 window.setTimeout(draw, 16);
21 } else {
22 if (window.testRunner) {
23 testRunner.notifyDone();
28 draw();
29 </script>
30 </body>
31 </html>