diff options
author | Josh Matthews <josh@joshmatthews.net> | 2017-10-30 09:31:22 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2017-10-30 18:26:08 -0400 |
commit | 75736751d9ffa1489c67387b89b79d7ebd06611c (patch) | |
tree | da615fa4454d45743b6fe656d3fc9a1643695158 /tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js | |
parent | 1b73cf33525afbbe2d077554d1965b74ef9ae5e3 (diff) | |
download | servo-75736751d9ffa1489c67387b89b79d7ebd06611c.tar.gz servo-75736751d9ffa1489c67387b89b79d7ebd06611c.zip |
Update web-platform-tests to revision 14cfa4d648cc1c853b4153268df672d21425f8c1
Diffstat (limited to 'tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js')
-rw-r--r-- | tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js b/tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js index 5d0f61838b1..4a0c66e1f28 100644 --- a/tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js +++ b/tests/wpt/web-platform-tests/web-animations/resources/effect-tests.js @@ -17,6 +17,11 @@ // } // function assert_computed_timing_for_each_phase(animation, property, values) { + // Some computed timing properties (e.g. 'progress') require floating-point + // comparison, whilst exact equality suffices for others. + const assert_property_equals = + (property === 'progress') ? assert_times_equal : assert_equals; + const effect = animation.effect; const timing = effect.getComputedTiming(); @@ -33,8 +38,8 @@ function assert_computed_timing_for_each_phase(animation, property, values) { } else { animation.currentTime = beforeActive; } - assert_equals(effect.getComputedTiming()[property], values.before, - `Value of ${property} in the before phase`); + assert_property_equals(effect.getComputedTiming()[property], values.before, + `Value of ${property} in the before phase`); // Active phase if (effect.getComputedTiming().activeDuration > 0) { @@ -43,8 +48,8 @@ function assert_computed_timing_for_each_phase(animation, property, values) { } else { animation.currentTime = activeAfter; } - assert_equals(effect.getComputedTiming()[property], values.activeBoundary, - `Value of ${property} at the boundary of the active phase`); + assert_property_equals(effect.getComputedTiming()[property], values.activeBoundary, + `Value of ${property} at the boundary of the active phase`); } else { assert_equals(values.activeBoundary, undefined, 'Test specifies a value to check during the active phase but' @@ -58,8 +63,8 @@ function assert_computed_timing_for_each_phase(animation, property, values) { } else { animation.currentTime = activeAfter + 1; } - assert_equals(effect.getComputedTiming()[property], values.after, - `Value of ${property} in the after phase`); + assert_property_equals(effect.getComputedTiming()[property], values.after, + `Value of ${property} in the after phase`); } else { assert_equals(values.after, undefined, 'Test specifies a value to check during the after phase but' |