Bug 1466031 - Tidy up test_animations-playstate.html; r?hiro
MozReview-Commit-ID: pDNtG1CDZJ
--- a/dom/animation/test/css-animations/test_animation-playstate.html
+++ b/dom/animation/test/css-animations/test_animation-playstate.html
@@ -8,55 +8,46 @@
@keyframes anim { }
</style>
<body>
<div id="log"></div>
<script>
'use strict';
test(t => {
- const div = addDiv(t);
- const cs = getComputedStyle(div);
- div.style.animation = 'anim 1000s';
+ const div = addDiv(t, { 'style': 'animation: anim 1000s' });
const animation = div.getAnimations()[0];
assert_equals(animation.playState, 'running');
}, 'Animation returns correct playState when running');
test(t => {
- const div = addDiv(t);
- const cs = getComputedStyle(div);
- div.style.animation = 'anim 1000s paused';
+ const div = addDiv(t, { 'style': 'animation: anim 1000s paused' });
const animation = div.getAnimations()[0];
assert_equals(animation.playState, 'paused');
}, 'Animation returns correct playState when paused');
test(t => {
- const div = addDiv(t);
- const cs = getComputedStyle(div);
- div.style.animation = 'anim 1000s';
+ const div = addDiv(t, { 'style': 'animation: anim 1000s' });
const animation = div.getAnimations()[0];
animation.pause();
assert_equals(animation.playState, 'paused');
}, 'Animation.playState updates when paused by script');
test(t => {
- const div = addDiv(t);
- const cs = getComputedStyle(div);
- div.style.animation = 'anim 1000s paused';
+ const div = addDiv(t, { 'style': 'animation: anim 1000s paused' });
const animation = div.getAnimations()[0];
div.style.animationPlayState = 'running';
// This test also checks that calling playState flushes style
assert_equals(animation.playState, 'running',
'Animation.playState reports running after updating'
+ ' animation-play-state (got: ' + animation.playState + ')');
}, 'Animation.playState updates when resumed by setting style');
test(t => {
- const div = addDiv(t);
- div.style.animation = 'anim 1000s';
+ const div = addDiv(t, { 'style': 'animation: anim 1000s' });
const animation = div.getAnimations()[0];
animation.cancel();
assert_equals(animation.playState, 'idle');
}, 'Animation returns correct playState when canceled');
</script>
</body>