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
--- 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);