1 description("Tests the timestamps provided to requestAnimationFrame callbacks");
3 function busyWait(millis) {
4 var start = Date.now();
5 while (Date.now()-start < millis) {}
8 var firstTimestamp = undefined;
10 window.requestAnimationFrame(function(timestamp) {
11 firstTimestamp = timestamp;
12 shouldBeDefined("firstTimestamp");
16 var secondTimestamp = undefined;
17 window.requestAnimationFrame(function(timestamp) {
18 secondTimestamp = timestamp;
19 shouldBeDefined("secondTimestamp");
20 shouldBe("firstTimestamp", "secondTimestamp");
23 if (window.testRunner)
24 testRunner.waitUntilDone();
26 requestAnimationFrame(function() {
27 shouldBeDefined("firstTimestamp");
28 isSuccessfullyParsed();
29 if (window.testRunner)
30 testRunner.notifyDone();