Skip to content

Commit 0200e97

Browse files
committed
Add tests for play() and reverse() not setting start times
1 parent 981fbec commit 0200e97

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/js/player.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,22 @@ suite('player', function() {
440440
p.currentTime = undefined;
441441
assert.equal(p.currentTime, 10);
442442
});
443+
test('play() should not set a start time', function() {
444+
var p = document.body.animate([], 1000);
445+
p.cancel();
446+
assert.equal(p.startTime, null);
447+
assert.equal(p.playState, 'idle');
448+
p.play();
449+
assert.equal(p.startTime, null);
450+
assert.equal(p.playState, 'pending');
451+
});
452+
test('reverse() should not set a start time', function() {
453+
var p = document.body.animate([], 1000);
454+
p.cancel();
455+
assert.equal(p.startTime, null);
456+
assert.equal(p.playState, 'idle');
457+
p.reverse();
458+
assert.equal(p.startTime, null);
459+
assert.equal(p.playState, 'pending');
460+
});
443461
});

0 commit comments

Comments
 (0)