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.

--HG--
extra : transplant_source : %23BU%CB%F3%3A%A8%226hWIw%E8VI%3A%94%A4V
This commit is contained in:
Patrick Brosset 2015-04-27 11:01:47 +02:00
parent 2411ce480f
commit 5aebb401b0

View File

@ -362,7 +362,9 @@ function waitForPlayState(player, playState) {
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,