Bug 1466031 - Tidy up test_animations-playstate.html; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Fri, 01 Jun 2018 16:27:01 +0900
changeset 802582 d2b095af49e0c361e2bad20d11389e4937ada7c1
parent 802581 17008420a96815c021ab4514f1e639938a6576db
child 802583 826d340c97df7316f6955b739d5b24dcaa07b661
push id111920
push userbmo:bbirtles@mozilla.com
push dateFri, 01 Jun 2018 07:32:08 +0000
reviewershiro
bugs1466031
milestone62.0a1
Bug 1466031 - Tidy up test_animations-playstate.html; r?hiro MozReview-Commit-ID: BPxJIHr3tC1
dom/animation/test/css-animations/test_animation-playstate.html
--- 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>