Skip to content

Commit

Permalink
Merge pull request web-platform-tests#7 from alancutter/finishPlay
Browse files Browse the repository at this point in the history
Upstream animation-play-after-finish-restarts.html from Blink
  • Loading branch information
suzyh authored Jul 15, 2016
2 parents 7ccaa7f + 962cf45 commit 9941a90
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions web-animations/interfaces/Animation/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,33 @@
}, 'play() throws when seeking an infinite-duration animation played in ' +
'reverse');

test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, 100 * MS_PER_SEC);
animation.currentTime = 1 * MS_PER_SEC;
assert_times_equal(animation.currentTime, 1 * MS_PER_SEC);
animation.play();
assert_times_equal(animation.currentTime, 1 * MS_PER_SEC);
}, 'play() leaves currentTime unchanged on running animation');

test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, 100 * MS_PER_SEC);
animation.finish();
assert_times_equal(animation.currentTime, 100 * MS_PER_SEC);
animation.play();
assert_times_equal(animation.currentTime, 0);
}, 'play() seeks back to start on finished animation');

test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, 100 * MS_PER_SEC);
animation.playbackRate = -1;
animation.currentTime = 0;
assert_times_equal(animation.currentTime, 0);
animation.play();
assert_times_equal(animation.currentTime, 100 * MS_PER_SEC);
}, 'play() seeks to end on reverse finished animation');

</script>
</body>

0 comments on commit 9941a90

Please sign in to comment.