Bug 927349 part 27 - Make DevTools actor wait on ready promise when playing; r=pbrosset
authorBrian Birtles <birtles@gmail.com>
Thu, 25 Dec 2014 16:28:25 +0900
changeset 247816 6d6a57b25ad0a29047dcf31c0bc129e69a315d0e
parent 247815 0f50d69bc63f17828782f3ba8fe81f7a4ddb2782
child 247817 650223edc2b4bac7c53979e5470d00fd7b1480fb
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs927349
milestone37.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 927349 part 27 - Make DevTools actor wait on ready promise when playing; r=pbrosset
toolkit/devtools/server/actors/animation.js
toolkit/devtools/server/tests/browser/browser_animation_actors_04.js
--- a/toolkit/devtools/server/actors/animation.js
+++ b/toolkit/devtools/server/actors/animation.js
@@ -173,16 +173,17 @@ let AnimationPlayerActor = ActorClass({
     response: {}
   }),
 
   /**
    * Play the player.
    */
   play: method(function() {
     this.player.play();
+    return this.player.ready;
   }, {
     request: {},
     response: {}
   })
 });
 
 let AnimationPlayerFront = FrontClass(AnimationPlayerActor, {
   AUTO_REFRESH_EVENT: "updated-state",
--- a/toolkit/devtools/server/tests/browser/browser_animation_actors_04.js
+++ b/toolkit/devtools/server/tests/browser/browser_animation_actors_04.js
@@ -33,18 +33,21 @@ function* playStateIsUpdatedDynamically(
   // using the CPOW.
   let cpow = content.document.querySelector(".short-animation");
   cpow.classList.remove("short-animation");
   let reflow = cpow.offsetWidth;
   cpow.classList.add("short-animation");
 
   let [player] = yield front.getAnimationPlayersForNode(node);
 
-  is(player.initialState.playState, "running",
-    "The playState is running while the transition is running");
+  // Bug 1113091 - We should wait for the player to become ready then
+  // test for the "running" state only
+  ok(player.initialState.playState == "running" ||
+     player.initialState.playState == "pending",
+    "The playState is running or pending while the transition is running");
 
   info("Wait until the animation stops (more than 1000ms)");
   yield wait(1500); // Waiting 1.5sec for good measure
 
   let state = yield player.getCurrentState();
   is(state.playState, "finished",
     "The animation has ended and the state has been updated");
   ok(state.currentTime > player.initialState.currentTime,