gecko-dev/dom/animation/test/css-transitions/file_animation-finished.html
Boris Zbarsky ca0723ea4a Bug 1159743. Stop forcing the dom.animations-api.core.enabled preference on in the test harness. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-cancel.html => dom/animation/test/css-animations/file_animation-cancel.html
rename : dom/animation/test/css-animations/test_animation-currenttime.html => dom/animation/test/css-animations/file_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-finish.html => dom/animation/test/css-animations/file_animation-finish.html
rename : dom/animation/test/css-animations/test_animation-finished.html => dom/animation/test/css-animations/file_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-pausing.html => dom/animation/test/css-animations/file_animation-pausing.html
rename : dom/animation/test/css-animations/test_animation-playstate.html => dom/animation/test/css-animations/file_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-ready.html => dom/animation/test/css-animations/file_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-starttime.html => dom/animation/test/css-animations/file_animation-starttime.html
rename : dom/animation/test/css-animations/test_animations-dynamic-changes.html => dom/animation/test/css-animations/file_animations-dynamic-changes.html
rename : dom/animation/test/css-animations/test_effect-name.html => dom/animation/test/css-animations/file_effect-name.html
rename : dom/animation/test/css-animations/test_effect-target.html => dom/animation/test/css-animations/file_effect-target.html
rename : dom/animation/test/css-animations/test_element-get-animations.html => dom/animation/test/css-animations/file_element-get-animations.html
rename : dom/animation/test/css-transitions/test_animation-cancel.html => dom/animation/test/css-transitions/file_animation-cancel.html
rename : dom/animation/test/css-transitions/test_animation-currenttime.html => dom/animation/test/css-transitions/file_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-finished.html => dom/animation/test/css-transitions/file_animation-finished.html
rename : dom/animation/test/css-transitions/test_animation-pausing.html => dom/animation/test/css-transitions/file_animation-pausing.html
rename : dom/animation/test/css-transitions/test_animation-ready.html => dom/animation/test/css-transitions/file_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-starttime.html => dom/animation/test/css-transitions/file_animation-starttime.html
rename : dom/animation/test/css-transitions/test_effect-name.html => dom/animation/test/css-transitions/file_effect-name.html
rename : dom/animation/test/css-transitions/test_effect-target.html => dom/animation/test/css-transitions/file_effect-target.html
rename : dom/animation/test/css-transitions/test_element-get-animations.html => dom/animation/test/css-transitions/file_element-get-animations.html
rename : dom/animation/test/document-timeline/test_document-timeline.html => dom/animation/test/document-timeline/file_document-timeline.html
rename : dom/animation/test/mozilla/test_deferred_start.html => dom/animation/test/mozilla/file_deferred_start.html
rename : layout/style/test/test_animations_pausing.html => layout/style/test/file_animations_pausing.html
2015-04-30 14:25:03 -04:00

62 lines
1.6 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<script src="../testcommon.js"></script>
<style>
.animated-div {
margin-left: 100px;
transition: margin-left 1000s linear 1000s;
}
</style>
<body>
<script>
'use strict';
const ANIM_DELAY_MS = 1000000; // 1000s
const ANIM_DUR_MS = 1000000; // 1000s
async_test(function(t) {
var div = addDiv(t, {'class': 'animated-div'});
flushComputedStyle(div);
div.style.marginLeft = '200px'; // initiate transition
var animation = div.getAnimations()[0];
animation.finish();
animation.finished.then(t.step_func(function() {
animation.play();
assert_equals(animation.currentTime, 0,
'Replaying a finished transition should reset its ' +
'currentTime');
t.done();
}));
}, 'Test restarting a finished transition');
async_test(function(t) {
var div = addDiv(t, {'class': 'animated-div'});
flushComputedStyle(div);
div.style.marginLeft = '200px'; // initiate transition
var animation = div.getAnimations()[0];
animation.ready.then(function() {
animation.playbackRate = -1;
return animation.finished;
}).then(t.step_func(function() {
animation.play();
// FIXME: once animation.effect.computedTiming.endTime is available (bug
// 1108055) we should use that here.
assert_equals(animation.currentTime, ANIM_DELAY_MS + ANIM_DUR_MS,
'Replaying a finished reversed transition should reset ' +
'its currentTime to the end of the effect');
t.done();
}));
}, 'Test restarting a reversed finished transition');
done();
</script>
</body>