Skip to content

Commit

Permalink
Bug 1612639 - Fix flaky upstreamed Web Animations WPT; r=hiro
Browse files Browse the repository at this point in the history
These tests assume that the startTime of the animation is calculated based on
the document current time at the moment the ready promise callback is run but
nothing in the spec requires that (only that it is calculated based on the
_ready time_).

Differential Revision: https://phabricator.services.mozilla.com/D61949

--HG--
extra : moz-landing-system : lando
  • Loading branch information
birtles committed Feb 7, 2020
1 parent cb722fa commit a346266
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@
assert_equals(animation.startTime, null,
'Start time should be unresolved');

const playTime = animation.timeline.currentTime;
animation.play();
assert_true(animation.pending, 'Animation should be play-pending');

await animation.ready;

assert_false(animation.pending, 'animation should no longer be pending');
assert_times_equal(animation.startTime, animation.timeline.currentTime,
'The start time of the playing animation should be set');
assert_greater_than(animation.startTime, playTime,
'The start time of the playing animation should be set');
}, 'Playing a canceled animation sets the start time');

promise_test(async t => {
const animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
animation.playbackRate = -1;
// animation.currentTime = 100 * MS_PER_SEC;
animation.cancel();
assert_equals(animation.startTime, null,
'Start time should be unresolved');

const playTime = animation.timeline.currentTime;
animation.play();
assert_true(animation.pending, 'Animation should be play-pending');

await animation.ready;

assert_false(animation.pending, 'Animation should no longer be pending');
assert_times_equal(animation.startTime,
animation.timeline.currentTime + 100 * MS_PER_SEC,
'The start time of a playing animation should be set');
assert_greater_than(animation.startTime, playTime + 100 * MS_PER_SEC,
'The start time of the playing animation should be set');
}, 'Playing a canceled animation backwards sets the start time');

</script>
Expand Down

0 comments on commit a346266

Please sign in to comment.