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.
--- 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);
});
/**