Bug 1357526 - Wait for animation detail rendering. r=pbro
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 26 Apr 2017 17:40:22 +0900
changeset 355994 6b0024a0be7465056df5d7c713c37205af0ab59b
parent 355993 f79e3e648100b57899044227624e7f5d874664ab
child 355995 b1eaeab8bc35aacda9a61d224c5bfb3e6887e8ef
push id31754
push userkwierso@gmail.com
push dateWed, 03 May 2017 00:28:51 +0000
treeherdermozilla-central@5eaf2d70eded [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1357526
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1357526 - Wait for animation detail rendering. r=pbro MozReview-Commit-ID: F1gP6kK4bMk
devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
--- a/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_added_animation.js
@@ -17,31 +17,35 @@ add_task(function* () {
 
   assertAnimationsDisplayed(panel, 0);
 
   info("Start an animation on the node");
   yield changeElementAndWait({
     selector: ".still",
     attributeName: "class",
     attributeValue: "ball animated"
-  }, panel, inspector);
+  }, panel, inspector, true);
 
   assertAnimationsDisplayed(panel, 1);
 
   info("Remove the animation class on the node");
   yield changeElementAndWait({
     selector: ".ball.animated",
     attributeName: "class",
     attributeValue: "ball still"
-  }, panel, inspector);
+  }, panel, inspector, false);
 
   assertAnimationsDisplayed(panel, 0);
 });
 
-function* changeElementAndWait(options, panel, inspector) {
+function* changeElementAndWait(options, panel, inspector, isDetailDisplayed) {
   let onPanelUpdated = panel.once(panel.UI_UPDATED_EVENT);
   let onInspectorUpdated = inspector.once("inspector-updated");
+  let onDetailRendered = isDetailDisplayed
+                         ? panel.animationsTimelineComponent
+                                .details.once("animation-detail-rendering-completed")
+                         : Promise.resolve();
 
   yield executeInContent("devtools:test:setAttribute", options);
 
-  yield promise.all([
-    onInspectorUpdated, onPanelUpdated, waitForAllAnimationTargets(panel)]);
+  yield promise.all([onInspectorUpdated, onPanelUpdated,
+                     waitForAllAnimationTargets(panel), onDetailRendered]);
 }