tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / animation / script-tests / request-animation-frame-timestamps.js
1 description("Tests the timestamps provided to requestAnimationFrame callbacks");
2
3 function busyWait(millis) {
4     var start = Date.now();
5     while (Date.now()-start < millis) {}
6 }
7
8 var firstTimestamp = undefined;
9
10 window.webkitRequestAnimationFrame(function(timestamp) {
11     firstTimestamp = timestamp;
12     shouldBeDefined("firstTimestamp");
13     busyWait(10);
14 });
15
16 var secondTimestamp = undefined;
17 window.webkitRequestAnimationFrame(function(timestamp) {
18     secondTimestamp = timestamp;
19     shouldBeDefined("secondTimestamp");
20     shouldBe("firstTimestamp", "secondTimestamp");
21 });
22
23 if (window.layoutTestController)
24     layoutTestController.display();
25
26 if (window.layoutTestController)
27     layoutTestController.waitUntilDone();
28
29 setTimeout(function() {
30     shouldBeDefined("firstTimestamp");
31 }, 100);
32
33 setTimeout(function() {
34     isSuccessfullyParsed();
35     if (window.layoutTestController)
36         layoutTestController.notifyDone();
37 }, 200);