Bug 1153463 - Intermittent browser_animation_setting_currentTime_works_and_pauses.js. r=miker
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 27 Apr 2015 11:01:47 +0200
changeset 241197 9c16aed65792
parent 241196 f6ee3076f6ab
child 241198 9d239aa810b0
push id12594
push userryanvm@gmail.com
push date2015-04-27 14:26 +0000
treeherderfx-team@9c16aed65792 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker
bugs1153463
milestone40.0a1
Bug 1153463 - Intermittent browser_animation_setting_currentTime_works_and_pauses.js. r=miker The failing test was rewinding a player and expecting it to pause at 0. But rewing first pauses (async) and then sets the time (async), and the test was only waiting for the player to pause. With this change, we now also wait until the time is the expected one.
browser/devtools/animationinspector/test/head.js
--- a/browser/devtools/animationinspector/test/head.js
+++ b/browser/devtools/animationinspector/test/head.js
@@ -357,17 +357,19 @@ function waitForPlayState(player, playSt
  * When done, check its currentTime.
  * @param {PlayerWidget} widget.
  * @param {Numer} time.
  * @return {Promise} Resolves when the animation is paused and tests have ran.
  */
 let checkPausedAt = Task.async(function*(widget, time) {
   info("Wait for the next auto-refresh");
 
-  yield waitForPlayState(widget.player, "paused");
+  yield waitForStateCondition(widget.player, state => {
+    return state.playState === "paused" && state.currentTime === time;
+  }, "Waiting for animation to pause at " + time + "ms");
 
   ok(widget.el.classList.contains("paused"), "The widget is in paused mode");
   is(widget.player.state.currentTime, time,
     "The player front's currentTime was set to " + time);
   is(widget.currentTimeEl.value, time, "The input's value was set to " + time);
 });
 
 /**