Bug 1145912 - Make single_transition_reversed and multiple_transitions more robust. r=birtles
authorCameron McCormack <cam@mcc.id.au>
Mon, 23 Mar 2015 13:07:25 +1100
changeset 263855 5ae6881f492e129eeb3315a2ea950ab8131fcba6
parent 263854 a2e34f98c85aae0dafc7a2c7fe0707b6b9925133
child 263856 587c4a3c4c6b34e17823d762b6427a049f2c3353
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)
reviewersbirtles
bugs1145912
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 1145912 - Make single_transition_reversed and multiple_transitions more robust. r=birtles
dom/animation/test/chrome/test_animation_observers.html
--- a/dom/animation/test/chrome/test_animation_observers.html
+++ b/dom/animation/test/chrome/test_animation_observers.html
@@ -310,29 +310,34 @@ function assert_records(expected, desc) 
     var firstPlayer = players[0];
 
     // Wait for the single MutationRecord for the AnimationPlayer addition to
     // be delivered.
     yield await_frame();
     assert_records([{ added: [firstPlayer], changed: [], removed: [] }],
                    "records after transition start");
 
-    // Wait a bit longer for the transition to take effect.
+    // Wait for the AnimationPlayer to get going, then seek well into
+    // the transition.
     yield await_frame();
+    firstPlayer.currentTime = 50000;
 
     // Reverse the transition by setting the background-color back to its
     // original value.
     e.style.backgroundColor = "yellow";
 
     // The reversal should cause the creation of a new AnimationPlayer.
     players = e.getAnimationPlayers();
     is(players.length, 1, "getAnimationPlayers().length after transition reversal");
 
     var secondPlayer = players[0];
 
+    ok(firstPlayer != secondPlayer,
+       "second AnimationPlayer should be different from the first");
+
     // Wait for the single MutationRecord for the removal of the original
     // AnimationPlayer and the addition of the new AnimationPlayer to
     // be delivered.
     yield await_frame();
     assert_records([{ added: [secondPlayer], changed: [], removed: [firstPlayer] }],
                    "records after transition reversal");
 
     // Cancel the transition.
@@ -360,18 +365,20 @@ function assert_records(expected, desc) 
     is(players.length, 3, "getAnimationPlayers().length after transition starts");
 
     // Wait for the single MutationRecord for the AnimationPlayer additions to
     // be delivered.
     yield await_frame();
     assert_records([{ added: players, changed: [], removed: [] }],
                    "records after transition starts");
 
-    // Wait for the AnimationPlayers to get going.
+    // Wait for the AnimationPlayers to get going, then seek well into
+    // the transitions.
     yield await_frame();
+    players.forEach(p => p.currentTime = 50000);
 
     is(players.filter(p => p.playState == "running").length, 3, "number of running AnimationPlayers");
 
     // Cancel one of the transitions by setting transition-property.
     e.style.transitionProperty = "background-color, line-height";
 
     var colorPlayer  = players.filter(p => p.playState != "running");
     var otherPlayers = players.filter(p => p.playState == "running");