mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 1142170 - Intermittent browser_animation_actors_10.js
--HG-- extra : rebase_source : 6841c13813708384f6891e82b3692eb263fbd2df
This commit is contained in:
parent
0140de65b4
commit
3e3b672b92
@ -100,7 +100,7 @@
|
||||
border-radius: 50%;
|
||||
background: blue;
|
||||
|
||||
animation: move 2s, glow 1s 2s infinite, grow 3s 1s 100;
|
||||
animation: move .5s, glow 1s 2s infinite, grow 3s 1s 100;
|
||||
}
|
||||
|
||||
@keyframes move {
|
||||
|
@ -31,29 +31,18 @@ add_task(function*() {
|
||||
{attributeName: "class", newValue: "multiple-animations-2"}
|
||||
]);
|
||||
|
||||
info("Retrieve the list of animation players for the node");
|
||||
info("Get the list of players, by the time this executes, the first, short, " +
|
||||
"animation should have ended.");
|
||||
let players = yield front.getAnimationPlayersForNode(node);
|
||||
is(players.length, 3, "3 animations are currently applied to the node");
|
||||
if (players.length === 3) {
|
||||
info("The short animation hasn't ended yet, wait for a bit.");
|
||||
// The animation lasts for 500ms, so 1000ms should do it.
|
||||
yield new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
||||
info("Waiting for the first animation to end");
|
||||
let player = players[0];
|
||||
player.startAutoRefresh();
|
||||
info("And get the list again");
|
||||
players = yield front.getAnimationPlayersForNode(node);
|
||||
}
|
||||
|
||||
let onFinished = new Promise(resolve => {
|
||||
let onNewState = (e, state) => {
|
||||
if (state.playState === "finished") {
|
||||
info("Received the 'finished' playState event");
|
||||
player.off(player.AUTO_REFRESH_EVENT, onNewState);
|
||||
resolve();
|
||||
}
|
||||
};
|
||||
info("Listening for auto-refresh events");
|
||||
player.on(player.AUTO_REFRESH_EVENT, onNewState);
|
||||
});
|
||||
yield onFinished;
|
||||
|
||||
info("Get the list of players again");
|
||||
players = yield front.getAnimationPlayersForNode(node);
|
||||
is(players.length, 2, "2 animations remain on the node");
|
||||
|
||||
is(players[0].state.duration, 1000, "The duration of the first animation is correct");
|
||||
|
Loading…
Reference in New Issue
Block a user