Bug 1120100 - part 2 - Intermittent browser_animation_actors_03.js; r=past

This commit is contained in:
Patrick Brosset 2015-01-12 14:47:59 +01:00
parent bb820223ba
commit 1bc459aa3f

View File

@ -43,11 +43,7 @@ function* playerHasAnInitialState(walker, front) {
function* playerStateIsCorrect(walker, front) {
info("Checking the state of the simple animation");
let node = yield walker.querySelector(walker.rootNode, ".simple-animation");
let [player] = yield front.getAnimationPlayersForNode(node);
yield player.ready();
let state = player.initialState;
let state = yield getAnimationStateForNode(walker, front, ".simple-animation", 0);
is(state.name, "move", "Name is correct");
is(state.duration, 2000, "Duration is correct");
// null = infinite count
@ -56,10 +52,7 @@ function* playerStateIsCorrect(walker, front) {
info("Checking the state of the transition");
node = yield walker.querySelector(walker.rootNode, ".transition");
[player] = yield front.getAnimationPlayersForNode(node);
state = player.initialState;
state = yield getAnimationStateForNode(walker, front, ".transition", 0);
is(state.name, "", "Transition has no name");
is(state.duration, 5000, "Transition duration is correct");
// transitions run only once
@ -68,14 +61,19 @@ function* playerStateIsCorrect(walker, front) {
info("Checking the state of one of multiple animations on a node");
node = yield walker.querySelector(walker.rootNode, ".multiple-animations");
// Checking the 2nd player
[, player] = yield front.getAnimationPlayersForNode(node);
yield player.ready();
state = player.initialState;
state = yield getAnimationStateForNode(walker, front, ".multiple-animations", 1);
is(state.name, "glow", "The 2nd animation's name is correct");
is(state.duration, 1000, "The 2nd animation's duration is correct");
is(state.iterationCount, 5, "The 2nd animation's iteration count is correct");
is(state.playState, "running", "The 2nd animation's playState is correct");
}
function* getAnimationStateForNode(walker, front, nodeSelector, playerIndex) {
let node = yield walker.querySelector(walker.rootNode, nodeSelector);
let players = yield front.getAnimationPlayersForNode(node);
let player = players[playerIndex];
yield player.ready();
let state = yield player.getCurrentState();
return state;
}