Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / animation / script-tests / request-animation-frame-prefix.js
blobeedb0769b850bf8a9b463e4b8f44ce6b6b658c1d
1 description("Tests the timestamps provided to prefixed webkitRequestAnimationFrame callbacks");
3 var firstTimestamp = undefined;
4 var secondTimestamp = undefined;
5 var legacyFirstTimestamp = undefined;
6 var legacySecondTimestamp = undefined;
7 var deltaError = undefined;
9 function busyWait(millis) {
10     var start = Date.now();
11     while (Date.now()-start < millis) {}
14 window.requestAnimationFrame(function(timestamp) {
15     firstTimestamp = timestamp;
16 });
18 window.webkitRequestAnimationFrame(function(timestamp) {
19     legacyFirstTimestamp = timestamp;
21     window.requestAnimationFrame(function(timestamp) {
22         secondTimestamp = timestamp;
23     });
25     window.webkitRequestAnimationFrame(function(timestamp) {
26         legacySecondTimestamp = timestamp;
28         shouldBeGreaterThanOrEqual("legacyFirstTimestamp", "firstTimestamp");
29         shouldBeGreaterThanOrEqual("legacySecondTimestamp", "secondTimestamp");
30         deltaError = Math.abs((legacySecondTimestamp - legacyFirstTimestamp) - (secondTimestamp - firstTimestamp));
31         shouldBeTrue("deltaError < 0.001");
32         testRunner.notifyDone();
33     });
35     busyWait(10);
36 });
38 if (window.testRunner)
39     testRunner.waitUntilDone();