blob: e7a5b9640612b773085baa1efd1a0d6e9827edc5 [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>
jsTestIsAsync = true;
description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
function busyWait(millis) {
var start = Date.now();
while (Date.now()-start < millis) {}
}
var firstTimestamp = undefined;
var secondTimestamp = undefined;
window.requestAnimationFrame(function(timestamp) {
firstTimestamp = timestamp;
shouldBeDefined("firstTimestamp");
window.requestAnimationFrame(function(timestamp) {
secondTimestamp = timestamp;
shouldBeDefined("secondTimestamp");
shouldBeTrue("secondTimestamp > firstTimestamp");
finishJSTest();
});
busyWait(10);
if (window.testRunner)
testRunner.displayAndTrackRepaints();
});
if (window.testRunner)
window.setTimeout(function() {
testRunner.displayAndTrackRepaints();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>