blob: 750e2c7c6651e1294f4ccb2a92615dc6160fc2e5 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script>
var currentFrame = 0;
var timestamp1 = 0;
var failed = false;
function finishTest()
{
if (failed)
testFailed("Some of the multiple requestAnimationFrame() callbacks, which were fired at the same time, received different timestamps.");
else
testPassed("All the multiple requestAnimationFrame() callbacks, which were fired at the same time, received the same timestamp.");
finishJSTest();
}
function doAnimation1(timestamp)
{
timestamp1 = timestamp;
const MaxFrames = 25;
if (currentFrame == MaxFrames)
finishTest();
else {
requestAnimationFrame(doAnimation1);
requestAnimationFrame(doAnimation2);
}
}
function doAnimation2(timestamp)
{
const WarmupFrames = 5;
if (++currentFrame > WarmupFrames && timestamp != timestamp1) {
testFailed("timestamp = " + timestamp + ", timestamp1 = " + timestamp1 + ", window.performance.now() = " + window.performance.now());
failed = true;
}
}
window.jsTestIsAsync = true;
requestAnimationFrame(doAnimation1);
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>