blob: a47b28373e31f10766fb149be9d78f0687dfae8c [file] [log] [blame]
<html>
<head>
<script src="../../js-test-resources/js-test-pre.js"></script>
<script>
window.jsTestIsAsync = true;
</script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Verifies the minimum resolution is 5 microseconds.");
var url = "../resources/square100.png";
document.write("<img src='" + url + "'>");
var t0, t1, shouldBeNearZeroOrOne;
window.addEventListener("load", function() {
var entries = performance.getEntries();
t0 = entries[0].fetchStart;
t1 = entries[1].fetchStart;
var expectedResolutionMilliseconds = 0.005;
var integerMultipleOfResolution = (t1 - t0) / expectedResolutionMilliseconds;
shouldBeNearZeroOrOne = integerMultipleOfResolution % 1;
shouldBe("shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10", "true");
finishJSTest();
});
</script>
<script src="../../js-test-resources/js-test-post.js"></script>
</body>
</html>