| <script src="../../resources/js-test-pre.js"></script> |
| context.fillStyle = "rgb(" + i + ", 0, 0)"; |
| context.fillRect(0, 0, 150, 150); |
| // 5 iterations should suffice to throttle the timer. |
| debug("Timer should still not be throttled because it is drawing on a canvas inside viewport."); |
| shouldBeFalse("internals.isTimerThrottled(timeoutId)"); |
| clearInterval(timeoutId); |
| context = document.getElementById("canvas").getContext('2d'); |
| timeoutId = setInterval(loop, 5); |
| debug("Timer should initially not be throttled."); |
| shouldBeFalse("internals.isTimerThrottled(timeoutId)"); |
| <body onload="runTest();"> |
| description("Test that a DOM timer drawing on a canvas inside viewport does not get throttled."); |
| <canvas id="canvas" width=150 height=150></canvas> |
| <script src="../../resources/js-test-post.js"></script> |