Bug 1495647 - Tidy up tests in play-states.html a little; r=hiro
authorBrian Birtles <birtles@gmail.com>
Wed, 03 Oct 2018 05:46:15 +0000
changeset 487698 15130d3c1c010f4b0b8fe7731936862dad65df85
parent 487697 039c4b2029a431fdf42c15abed05e7f5ba1359fd
child 487699 eb6c2a002b78687405182d04b16dc441135c4108
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewershiro
bugs1495647
milestone64.0a1
Bug 1495647 - Tidy up tests in play-states.html a little; r=hiro Differential Revision: https://phabricator.services.mozilla.com/D7573
testing/web-platform/tests/web-animations/timing-model/animations/play-states.html
--- a/testing/web-platform/tests/web-animations/timing-model/animations/play-states.html
+++ b/testing/web-platform/tests/web-animations/timing-model/animations/play-states.html
@@ -17,18 +17,17 @@ test(t => {
   assert_equals(animation.currentTime, null,
                 'Current time should be initially unresolved');
 
   assert_equals(animation.playState, 'idle');
 }, 'reports \'idle\' for an animation with an unresolved current time'
    + ' and no pending tasks')
 
 test(t => {
-  const div = createDiv(t);
-  const animation = div.animate({}, 100 * MS_PER_SEC);
+  const animation = createDiv(t).animate({}, 100 * MS_PER_SEC);
 
   animation.pause();
 
   assert_equals(animation.playState, 'paused');
 }, 'reports \'paused\' for an animation with a pending pause task');
 
 test(t => {
   const animation = new Animation(
@@ -129,28 +128,26 @@ test(t => {
   animation.playbackRate = -1;
   animation.currentTime = 0;
 
   assert_equals(animation.playState, 'finished');
 }, 'reports \'finished\' when playback rate < 0 and'
    + ' current time = 0');
 
 test(t => {
-  const div = createDiv(t);
-  const animation = div.animate({}, 0);
+  const animation = createDiv(t).animate({}, 0);
   assert_equals(animation.startTime, null,
                 'Sanity check: start time should be unresolved');
 
   assert_equals(animation.playState, 'finished');
 }, 'reports \'finished\' when playback rate > 0 and'
    + ' current time = target effect end and there is a pending play task');
 
 test(t => {
-  const div = createDiv(t);
-  const animation = div.animate({}, 100 * MS_PER_SEC);
+  const animation = createDiv(t).animate({}, 100 * MS_PER_SEC);
   assert_equals(animation.startTime, null,
                 'Sanity check: start time should be unresolved');
 
   assert_equals(animation.playState, 'running');
 }, 'reports \'running\' when playback rate > 0 and'
    + ' current time < target effect end and there is a pending play task');
 
 </script>