Bug 1242872 - Part 9: Should not assume any order of animations in MurationObserver. r?pbrosset draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Fri, 19 Feb 2016 16:43:08 +0900
changeset 332074 3b19b2fbde43139797f4c9f7096ae24bc107c9fc
parent 332073 b9ddad0ab27f2f4e9c29342787e303948e124599
child 514536 24afac7e636301cd4787fcd7a9d3c3de11c7411e
push id11153
push userbmo:hiikezoe@mozilla-japan.org
push dateFri, 19 Feb 2016 07:43:32 +0000
reviewerspbrosset
bugs1242872
milestone47.0a1
Bug 1242872 - Part 9: Should not assume any order of animations in MurationObserver. r?pbrosset After patch 7, the order of animations in MutationObserver has been reversed. When we want to use the animations ordering by something, we need to sort it first. MozReview-Commit-ID: 7xOYNsuSbvA
devtools/server/tests/browser/browser_animation_emitMutations.js
--- a/devtools/server/tests/browser/browser_animation_emitMutations.js
+++ b/devtools/server/tests/browser/browser_animation_emitMutations.js
@@ -25,20 +25,20 @@ add_task(function*() {
   yield node.modifyAttributes([
     {attributeName: "class", newValue: "multiple-animations"}
   ]);
   let changes = yield onMutations;
 
   ok(true, "The mutations event was emitted");
   is(changes.length, 2, "There are 2 changes in the mutation event");
   ok(changes.every(({type}) => type === "added"), "Both changes are additions");
-  is(changes[0].player.initialState.name, "move",
-    "The first added animation is 'move'");
-  is(changes[1].player.initialState.name, "glow",
-    "The first added animation is 'glow'");
+
+  let names = changes.map(c => c.player.initialState.name).sort();
+  is(names[0], "glow", "The animation 'glow' was added");
+  is(names[1], "move", "The animation 'move' was added");
 
   info("Store the 2 new players for comparing later");
   let p1 = changes[0].player;
   let p2 = changes[1].player;
 
   info("Listen for removed animations");
   onMutations = once(animations, "mutations");