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 221324 cfe757e478d59cb02ced7a2f6fcfa897b9992b73
parent 221323 79cac8c71159fb782d5073b366bdc904b4c1e6d8
child 221325 eaf834051cbd3de798f87e33c64d113032f5a77b
push id28016
push userphilringnalda@gmail.com
push dateThu, 25 Dec 2014 19:58:27 +0000
treeherdermozilla-central@3a86099219cb [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,