| Index: LayoutTests/http/tests/misc/webtiming-resolution.html
|
| diff --git a/LayoutTests/http/tests/misc/webtiming-resolution.html b/LayoutTests/http/tests/misc/webtiming-resolution.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ea0027180edea1a4d0c9e7e8003cb5fc4927199f
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/misc/webtiming-resolution.html
|
| @@ -0,0 +1,24 @@
|
| +<html>
|
| +<head>
|
| +<script src="/js-test-resources/js-test.js"></script>
|
| +</head>
|
| +<body>
|
| +<p id="description"></p>
|
| +<div id="console"></div>
|
| +<script>
|
| +description("Verifies the minimum resolution is 5 microseconds.");
|
| +
|
| +var t0 = performance.now();
|
| +var t1 = performance.now();
|
| +while (t0 == t1) {
|
| + t1 = performance.now();
|
| +}
|
| +
|
| +var expectedResolutionMilliseconds = 0.005;
|
| +var integerMultipleOfResolution = (t1 - t0) / expectedResolutionMilliseconds;
|
| +var shouldBeNearZeroOrOne = integerMultipleOfResolution % 1;
|
| +shouldBe("shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10", "true");
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|