| <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> |