Bug 1466031 - Tidy up test_animations-playstate.html; r=hiro
authorBrian Birtles <birtles@gmail.com>
Mon, 04 Jun 2018 10:20:56 +0900
changeset 421153 4f526a64e149c4c650f7ad54858714689070e6cf
parent 421152 43b6a75465244fe6c9e9cddf7aad2c6d6d833181
child 421154 225a32bacfbc737e9934ba301fc447ce58e500c8
push id34089
push userdluca@mozilla.com
push dateMon, 04 Jun 2018 18:11:55 +0000
treeherdermozilla-central@d8f180ab7492 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1466031
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466031 - Tidy up test_animations-playstate.html; r=hiro
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>