blob: ff42485d738af54bfc3d7244ab18f1f43cf7fe52 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
<script>
jsTestIsAsync = true;
description("This test verifies that window.performance.now() is monotonically increasing.");
var isMonotonicClock = false;
function checkTimestamp(previousTimestamp) {
currentTimestamp = performance.now();
isMonotonicClock = previousTimestamp <= currentTimestamp;
if (isMonotonicClock)
setTimeout('checkTimestamp(currentTimestamp)', 0);
}
function start() {
if (!window.testRunner)
return;
checkTimestamp(performance.now());
setTimeout(function() {
shouldBe("isMonotonicClock", "true");
finishJSTest(); }
, 100);
window.testRunner.displayAndTrackRepaints();
}
onload = start();
</script>
</head>
<body>
<div id="test"> </div>
</body>
<script src="../../../resources/js-test-post.js"></script>
</html>