Layout Test fast/animation/request-animation-frame-timestamps-advance.html is failing
[WebKit-https.git] / LayoutTests / fast / animation / script-tests / request-animation-frame-timestamps-advance.js
1 jsTestIsAsync = true;
2
3 description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
4
5 function busyWait(millis) {
6     var start = Date.now();
7     while (Date.now()-start < millis) {}
8 }
9
10 var firstTimestamp = undefined;
11 var secondTimestamp = undefined;
12
13 window.webkitRequestAnimationFrame(function(timestamp) {
14     firstTimestamp = timestamp;
15     shouldBeDefined("firstTimestamp");
16     window.webkitRequestAnimationFrame(function(timestamp) {
17         secondTimestamp = timestamp;
18         shouldBeDefined("secondTimestamp");
19         shouldBeTrue("secondTimestamp > firstTimestamp");
20         finishJSTest();
21     });
22     busyWait(10);
23     if (window.layoutTestController)
24         layoutTestController.display();
25 });
26
27
28 if (window.layoutTestController)
29     window.setTimeout(function() {
30         layoutTestController.display();
31     });
32
33
34 var successfullyParsed = true;