Bug 1430654 - Double epsilon value for assert_times_equal. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 22 Jan 2018 14:57:57 +0900
changeset 723032 52511027c1393dcd0c145e3996b5c9274dbda4a8
parent 723031 9e2b00286bf43225c4578256754a7d5513466b94
child 723033 19287d57237080d9ee90462bbc519ac8cb1eb5e8
push id96298
push userhikezoe@mozilla.com
push dateMon, 22 Jan 2018 06:02:45 +0000
reviewersbirtles
bugs1430654
milestone59.0a1
Bug 1430654 - Double epsilon value for assert_times_equal. r?birtles Since the function assumes that both of actual and expected values have the same precision requirements. MozReview-Commit-ID: 4C3TAH6mUVg
dom/animation/test/testcommon.js
testing/web-platform/tests/web-animations/testcommon.js
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -21,17 +21,17 @@ const MS_PER_SEC = 1000;
  */
 var TIME_PRECISION = 0.0005; // ms
 
 /*
  * Allow implementations to substitute an alternative method for comparing
  * times based on their precision requirements.
  */
 function assert_times_equal(actual, expected, description) {
-  assert_approx_equals(actual, expected, TIME_PRECISION, description);
+  assert_approx_equals(actual, expected, TIME_PRECISION * 2, description);
 }
 
 /*
  * Compare a time value based on its precision requirements with a fixed value.
  */
 function assert_time_equals_literal(actual, expected, description) {
   assert_approx_equals(actual, expected, TIME_PRECISION, description);
 }
--- a/testing/web-platform/tests/web-animations/testcommon.js
+++ b/testing/web-platform/tests/web-animations/testcommon.js
@@ -16,17 +16,17 @@ const MS_PER_SEC = 1000;
 //
 // [1] https://drafts.csswg.org/web-animations/#precision-of-time-values
 const TIME_PRECISION = 0.0005; // ms
 
 // Allow implementations to substitute an alternative method for comparing
 // times based on their precision requirements.
 if (!window.assert_times_equal) {
   window.assert_times_equal = (actual, expected, description) => {
-    assert_approx_equals(actual, expected, TIME_PRECISION, description);
+    assert_approx_equals(actual, expected, TIME_PRECISION * 2, description);
   };
 }
 
 // Allow implementations to substitute an alternative method for comparing
 // a time value based on its precision requirements with a fixed value.
 if (!window.assert_time_equals_literal) {
   window.assert_time_equals_literal = (actual, expected, description) => {
     assert_approx_equals(actual, expected, TIME_PRECISION, description);