Title: [186219] trunk/LayoutTests
Revision
186219
Author
achristen...@apple.com
Date
2015-07-01 23:41:31 -0700 (Wed, 01 Jul 2015)

Log Message

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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (186218 => 186219)


--- trunk/LayoutTests/ChangeLog	2015-07-02 04:46:43 UTC (rev 186218)
+++ trunk/LayoutTests/ChangeLog	2015-07-02 06:41:31 UTC (rev 186219)
@@ -1,3 +1,11 @@
+2015-07-01  Alex Christensen  <achristen...@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  <cdu...@apple.com>
 
         Reduce resolution of performance.now

Modified: trunk/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt (186218 => 186219)


--- trunk/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt	2015-07-02 04:46:43 UTC (rev 186218)
+++ trunk/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt	2015-07-02 06:41:31 UTC (rev 186219)
@@ -3,5 +3,5 @@
 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
 

Modified: trunk/LayoutTests/http/tests/misc/webtiming-resolution.html (186218 => 186219)


--- trunk/LayoutTests/http/tests/misc/webtiming-resolution.html	2015-07-02 04:46:43 UTC (rev 186218)
+++ trunk/LayoutTests/http/tests/misc/webtiming-resolution.html	2015-07-02 06:41:31 UTC (rev 186219)
@@ -14,7 +14,10 @@
     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>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to