Bug 1109390 part 27 - Add further test to test_animations-pausing.html for cancelling a pause by setting the current time; r=jwatt

This commit is contained in:
Brian Birtles 2015-04-01 12:23:25 +09:00
Родитель 51d5cba7a7
Коммит 955a3c9adb
1 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -176,4 +176,27 @@ async_test(function(t) {
}, 'pause() applies pending changes to animation-play-state first');
// (Note that we can't actually test for this; see comment above, in test-body.)
async_test(function(t) {
var div = addDiv(t, { style: 'animation: anim 1000s' });
var animation = div.getAnimations()[0];
var readyPromiseRun = false;
animation.ready.then(t.step_func(function() {
div.style.animationPlayState = 'paused';
assert_equals(animation.playState, 'pending', 'Animation is pause pending');
// Set current time
animation.currentTime = 5000;
assert_equals(animation.playState, 'running',
'Animation is running immediately after setting currentTime');
// The ready promise should now be resolved. If it's not then test will
// probably time out before anything else happens that causes it to resolve.
return animation.ready;
})).then(t.step_func(function() {
t.done();
}));
}, 'Setting the current time cancels a pending pause');
</script>