Bug 1153463 - Intermittent browser_animation_setting_currentTime_works_and_pauses.js. r=miker, a=test-only
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 27 Apr 2015 11:01:47 +0200
changeset 267253 b4e870496515432dcec4286260b2947b61317db9
parent 267252 87932d0905f8391d69a83af2284d5746ba4ee608
child 267254 9242257d7697067836b210ffece24addd5d36cad
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker, test-only
bugs1153463
milestone39.0a2
Bug 1153463 - Intermittent browser_animation_setting_currentTime_works_and_pauses.js. r=miker, a=test-only 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
@@ -327,17 +327,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);
 });
 
 /**