<!DOCTYPE html>
<title>Tests the timestamps provided to requestAnimationFrame callbacks advance</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
async_test(t => {
function busyWait(millis) {
var start = Date.now();
while (Date.now() - start < millis) { }
}
var firstTimestamp;
var secondTimestamp;
window.requestAnimationFrame(function(timestamp) {
firstTimestamp = timestamp;
t.step(function() {
assert_true(!!firstTimestamp);
});
window.requestAnimationFrame(function(timestamp) {
secondTimestamp = timestamp;
t.step(function() {
assert_true(!!secondTimestamp);
assert_true(secondTimestamp > firstTimestamp);
});
t.done();
});
busyWait(10);
});
}, "Test the timestamps provided to rAF callbacks advance");
</script>