* http/tests/misc/webtiming-resolution-expected.txt:
* http/tests/misc/webtiming-resolution.html:
Properly and explicitly test if the time delta is close to a multiple of the expected resolution.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186219
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-07-01 Alex Christensen <achristensen@webkit.org>
+
+ Fix test from r186208 and r186216.
+
+ * http/tests/misc/webtiming-resolution-expected.txt:
+ * http/tests/misc/webtiming-resolution.html:
+ Properly and explicitly test if the time delta is close to a multiple of the expected resolution.
+
2015-07-01 Chris Dumez <cdumez@apple.com>
Reduce resolution of performance.now
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS Math.abs(1 - (t1 - t0) / 0.005) < 1e-10 is true
+PASS shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10 is true
t1 = performance.now();
}
-shouldBe("Math.abs(1 - (t1 - t0) / 0.005) < 1e-10", "true");
+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>