Bug 1142170 - Intermittent browser_animation_actors_10.js
authorPatrick Brosset <pbrosset@mozilla.com>
Fri, 13 Mar 2015 16:30:00 +0100
changeset 233845 badc8cab63043afe59c9b7f1387e0a790a7dbbe0
parent 233844 a83f1ca8b7513dbb9280ef7ea4e5ba34ad4526ec
child 233846 75dc344c04d189bdf81624f2734f03c099b127f1
push id28425
push usercbook@mozilla.com
push dateTue, 17 Mar 2015 10:33:06 +0000
treeherdermozilla-central@a194e8023090 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1142170
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 1142170 - Intermittent browser_animation_actors_10.js
toolkit/devtools/server/tests/browser/animation.html
toolkit/devtools/server/tests/browser/browser_animation_actors_10.js
--- a/toolkit/devtools/server/tests/browser/animation.html
+++ b/toolkit/devtools/server/tests/browser/animation.html
@@ -95,17 +95,17 @@
   .multiple-animations-2 {
     display: inline-block;
 
     width: 50px;
     height: 50px;
     border-radius: 50%;
     background: blue;
 
-    animation: move 2s, glow 1s 2s infinite, grow 3s 1s 100;
+    animation: move .5s, glow 1s 2s infinite, grow 3s 1s 100;
   }
 
   @keyframes move {
     100% {
       transform: translateY(100px);
     }
   }
 
--- a/toolkit/devtools/server/tests/browser/browser_animation_actors_10.js
+++ b/toolkit/devtools/server/tests/browser/browser_animation_actors_10.js
@@ -26,39 +26,28 @@ add_task(function*() {
   info("Retrieve a non animated node");
   let node = yield walker.querySelector(walker.rootNode, ".not-animated");
 
   info("Apply the multiple-animations-2 class to start the animations");
   yield node.modifyAttributes([
     {attributeName: "class", newValue: "multiple-animations-2"}
   ]);
 
-  info("Retrieve the list of animation players for the node");
+  info("Get the list of players, by the time this executes, the first, short, " +
+    "animation should have ended.");
   let players = yield front.getAnimationPlayersForNode(node);
-  is(players.length, 3, "3 animations are currently applied to the node");
-
-  info("Waiting for the first animation to end");
-  let player = players[0];
-  player.startAutoRefresh();
+  if (players.length === 3) {
+    info("The short animation hasn't ended yet, wait for a bit.");
+    // The animation lasts for 500ms, so 1000ms should do it.
+    yield new Promise(resolve => setTimeout(resolve, 1000));
 
-  let onFinished = new Promise(resolve => {
-    let onNewState = (e, state) => {
-      if (state.playState === "finished") {
-        info("Received the 'finished' playState event");
-        player.off(player.AUTO_REFRESH_EVENT, onNewState);
-        resolve();
-      }
-    };
-    info("Listening for auto-refresh events");
-    player.on(player.AUTO_REFRESH_EVENT, onNewState);
-  });
-  yield onFinished;
+    info("And get the list again");
+    players = yield front.getAnimationPlayersForNode(node);
+  }
 
-  info("Get the list of players again");
-  players = yield front.getAnimationPlayersForNode(node);
   is(players.length, 2, "2 animations remain on the node");
 
   is(players[0].state.duration, 1000, "The duration of the first animation is correct");
   is(players[0].state.delay, 2000, "The delay of the first animation is correct");
   is(players[0].state.iterationCount, null, "The iterationCount of the first animation is correct");
 
   is(players[1].state.duration, 3000, "The duration of the second animation is correct");
   is(players[1].state.delay, 1000, "The delay of the second animation is correct");