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 260314 c31c2a198a71
parent 260313 4ea8cdc621e8
child 260315 5d903629f9bd
push id746
push userryanvm@gmail.com
push date2015-04-28 22:47 +0000
treeherdermozilla-release@348c2ae68d50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker, test-only
bugs1153463
milestone38.0
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
@@ -341,17 +341,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);
 });
 
 /**