blob: c04f43d4dc700cc178883f4482fca0fb352ba829 [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.display();
}
onload = start();
</script>
</head>
<body>
<div id="test"> </div>
</body>
<script src="../../../resources/js-test-post.js"></script>
</html>