Bug 1109390 part 2 - Remove some unneeded startTime tests; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Tue, 24 Mar 2015 09:21:08 +0900
changeset 264033 35b6ee1472e9adcf3c4da0a4a7558ca619f4aba6
parent 264032 03dd3dff57b3cd7d94e61fef4009a01f190c1a68
child 264034 cb71bf27300ce899920a2c6b89d66c61211c7547
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1109390
milestone39.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 1109390 part 2 - Remove some unneeded startTime tests; r=jwatt Now that we have separate tests for checking the initial state of startTime we can remove these checks from tests for setting the startTime. Also, while we're at it, we needn't check the playState and animationPlayState since these should be covered by other tests.
dom/animation/test/css-animations/test_animation-player-starttime.html
dom/animation/test/css-transitions/test_animation-player-starttime.html
--- a/dom/animation/test/css-animations/test_animation-player-starttime.html
+++ b/dom/animation/test/css-animations/test_animation-player-starttime.html
@@ -194,37 +194,16 @@ function EventWatcher(watchedNode, event
 // animation. The terms can be found here:
 //
 //   http://w3c.github.io/web-animations/#animation-node-phases-and-states
 //
 // Note the distinction between "player start time" and "animation start time".
 // The former is the start of the start delay. The latter is the start of the
 // active interval. (If there is no delay, they are the same.)
 
-// Called when startTime is set to the time the start delay would ideally
-// start (not accounting for any delay to next paint tick).
-function checkStateOnSettingStartTimeToAnimationCreationTime(player)
-{
-  // We don't test player.startTime since our caller just set it.
-
-  assert_equals(player.playState, 'running',
-    'AnimationPlayer.playState should be "running" at the start of ' +
-    'the start delay');
-
-  assert_equals(player.source.target.style.animationPlayState, 'running',
-    'AnimationPlayer.source.target.style.animationPlayState should be ' +
-    '"running" at the start of the start delay');
-
-  var div = player.source.target;
-  var marginLeft = parseFloat(getComputedStyle(div).marginLeft);
-  assert_equals(marginLeft, UNANIMATED_POSITION,
-                'the computed value of margin-left should be unaffected ' +
-                'at the beginning of the start delay');
-}
-
 // Called when the ready Promise's callbacks should happen
 function checkStateOnReadyPromiseResolved(player)
 {
   assert_less_than_equal(player.startTime, player.timeline.currentTime,
     'AnimationPlayer.startTime should be less than the timeline\'s ' +
     'currentTime on the first paint tick after animation creation');
 
   assert_equals(player.playState, 'running',
@@ -367,47 +346,24 @@ async_test(function(t)
     t.done();
   }));
 }, 'startTime while play-pending from finished state');
 
 
 test(function(t)
 {
   var div = addDiv(t, {'class': 'animated-div'});
-
   div.style.animation = ANIM_PROPERTY_VAL;
 
   var player = div.getAnimationPlayers()[0];
-
-  // Animations shouldn't start until the next paint tick, so:
-  assert_equals(player.startTime, null,
-    'AnimationPlayer.startTime should be unresolved when an animation ' +
-    'is initially created');
-
-  assert_equals(player.playState, "pending",
-    'AnimationPlayer.playState should be "pending" when an animation ' +
-    'is initially created');
-
-  assert_equals(player.source.target.style.animationPlayState, 'running',
-    'AnimationPlayer.source.target.style.animationPlayState should be ' +
-    '"running" when an animation is initially created');
-
-  // XXX Ideally we would have a test to check the ready Promise is initially
-  // unresolved, but currently there is no Web API to do that. Waiting for the
-  // ready Promise with a timeout doesn't work because the resolved callback
-  // will be called (async) regardless of whether the Promise was resolved in
-  // the past or is resolved in the future.
-
   var currentTime = player.timeline.currentTime;
   player.startTime = currentTime;
   assert_approx_equals(player.startTime, currentTime, 0.0001, // rounding error
     'Check setting of startTime actually works');
-
-  checkStateOnSettingStartTimeToAnimationCreationTime(player);
-}, 'Sanity test to check round-tripping assigning to new animation\'s ' +
+}, 'Sanity test to check round-tripping assigning to a new animation\'s ' +
    'startTime');
 
 
 async_test(function(t) {
   var div = addDiv(t, {'class': 'animated-div'});
   var eventWatcher = new EventWatcher(div, CSS_ANIM_EVENTS);
 
   div.style.animation = ANIM_PROPERTY_VAL;
--- a/dom/animation/test/css-transitions/test_animation-player-starttime.html
+++ b/dom/animation/test/css-transitions/test_animation-player-starttime.html
@@ -185,33 +185,16 @@ function EventWatcher(watchedNode, event
 // animation. The terms can be found here:
 //
 //   http://w3c.github.io/web-animations/#animation-node-phases-and-states
 //
 // Note the distinction between "player start time" and "animation start time".
 // The former is the start of the start delay. The latter is the start of the
 // active interval. (If there is no delay, they are the same.)
 
-// Called when startTime is set to the time the start delay would ideally
-// start (not accounting for any delay to next paint tick).
-function checkStateOnSettingStartTimeToAnimationCreationTime(player)
-{
-  // We don't test player.startTime since our caller just set it.
-
-  assert_equals(player.playState, 'running',
-    'AnimationPlayer.playState should be "running" at the start of ' +
-    'the start delay');
-
-  var div = player.source.target;
-  var marginLeft = parseFloat(getComputedStyle(div).marginLeft);
-  assert_equals(marginLeft, INITIAL_POSITION,
-                'the computed value of margin-left should be unaffected ' +
-                'at the beginning of the start delay');
-}
-
 // Called when the ready Promise's callbacks should happen
 function checkStateOnReadyPromiseResolved(player)
 {
   assert_less_than_equal(player.startTime, player.timeline.currentTime,
     'AnimationPlayer.startTime should be less than the timeline\'s ' +
     'currentTime on the first paint tick after animation creation');
 
   assert_equals(player.playState, 'running',
@@ -277,43 +260,24 @@ test(function(t)
   var player = div.getAnimationPlayers()[0];
   assert_equals(player.startTime, null, 'startTime is unresolved');
 }, 'startTime of a newly created transition is unresolved');
 
 
 test(function(t)
 {
   var div = addDiv(t, {'class': 'animated-div'});
-
   flushComputedStyle(div);
   div.style.marginLeft = '200px'; // initiate transition
 
   var player = div.getAnimationPlayers()[0];
-
-  // Animations shouldn't start until the next paint tick, so:
-  assert_equals(player.startTime, null,
-    'AnimationPlayer.startTime should be unresolved when an animation ' +
-    'is initially created');
-
-  assert_equals(player.playState, "pending",
-    'AnimationPlayer.playState should be "pending" when an animation ' +
-    'is initially created');
-
-  // XXX Ideally we would have a test to check the ready Promise is initially
-  // unresolved, but currently there is no Web API to do that. Waiting for the
-  // ready Promise with a timeout doesn't work because the resolved callback
-  // will be called (async) regardless of whether the Promise was resolved in
-  // the past or is resolved in the future.
-
   var currentTime = player.timeline.currentTime;
   player.startTime = currentTime;
   assert_approx_equals(player.startTime, currentTime, 0.0001, // rounding error
     'Check setting of startTime actually works');
-
-  checkStateOnSettingStartTimeToAnimationCreationTime(player);
 }, 'Sanity test to check round-tripping assigning to new animation\'s ' +
    'startTime');
 
 
 async_test(function(t) {
   var div = addDiv(t, {'class': 'animated-div'});
   var eventWatcher = new EventWatcher(div, 'transitionend');