blob: 79e6b2b6eee86c2786efd3c381f13c90cf8cff50 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<span id="e"></span>
<span id="f"></span>
<script>
description("Tests the timestamps provided to requestAnimationFrame callbacks");
function busyWait(millis) {
var start = Date.now();
while (Date.now()-start < millis) {}
}
var firstTimestamp = undefined;
window.requestAnimationFrame(function(timestamp) {
firstTimestamp = timestamp;
shouldBeDefined("firstTimestamp");
busyWait(10);
});
var secondTimestamp = undefined;
window.requestAnimationFrame(function(timestamp) {
secondTimestamp = timestamp;
shouldBeDefined("secondTimestamp");
shouldBe("firstTimestamp", "secondTimestamp");
});
if (window.testRunner)
testRunner.displayAndTrackRepaints();
if (window.testRunner)
testRunner.waitUntilDone();
setTimeout(function() {
shouldBeDefined("firstTimestamp");
}, 100);
setTimeout(function() {
isSuccessfullyParsed();
if (window.testRunner)
testRunner.notifyDone();
}, 200);
</script>
</body>
</html>