3 description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
5 function busyWait(millis
) {
6 var start
= Date
.now();
7 while (Date
.now()-start
< millis
) {}
10 var firstTimestamp
= undefined;
11 var secondTimestamp
= undefined;
13 window
.requestAnimationFrame(function(timestamp
) {
14 firstTimestamp
= timestamp
;
15 shouldBeDefined("firstTimestamp");
16 window
.requestAnimationFrame(function(timestamp
) {
17 secondTimestamp
= timestamp
;
18 shouldBeDefined("secondTimestamp");
19 shouldBeTrue("secondTimestamp > firstTimestamp");