3 <script src="../../resources/js-test-pre.js"></script>
9 function runTest(timestamp)
11 square = document.getElementById('square');
13 if (counter == 0 && window.internals)
14 shouldBe("window.internals.isPaintingFrequently(square)", "false");
16 var oldLeft = square.offsetLeft;
17 var oldTop = square.offsetTop;
18 square.style.left = (oldLeft + 1) + 'px';
19 square.style.top = (oldTop + 1) + 'px';
22 if (window.testRunner) {
23 // For debug builds that can't animate fast we just do a large number of increments.
24 for (var i = 0; i < debugFudge; ++i)
25 window.internals.incrementFrequentPaintCounter(square);
29 requestAnimationFrame(runTest);
30 else if (window.internals) {
31 shouldBe("window.internals.isPaintingFrequently(square)", "true");
38 <div style="position:absolute; left:0;top:0">
40 <div style="position:absolute; left:0;top:0;width:2px; height:2px; background-color:green" id="square"></div>
44 description("This tests that we kick into high frequency painting mode properly when animating something quickly.");
45 window.jsTestIsAsync = true;
46 window.requestAnimationFrame(runTest);
48 <script src="../../resources/js-test-post.js"></script>