Bug 1443319 - Remove unnecessary generator on waitForAnimationTimelineRendering r=ochameau draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 05 Mar 2018 14:08:05 -0800
changeset 776677 693ed71b52370aa650f53586b7856aca42f1d40b
parent 763042 69f9ae4f6e8943d24569a9e4380f6df869f56b73
push id104946
push userbmo:ystartsev@mozilla.com
push dateTue, 03 Apr 2018 15:21:56 +0000
reviewersochameau
bugs1443319
milestone60.0a1
Bug 1443319 - Remove unnecessary generator on waitForAnimationTimelineRendering r=ochameau - Fixes failing test MozReview-Commit-ID: CvXrdcCZBsN
devtools/client/animationinspector/test/head.js
--- a/devtools/client/animationinspector/test/head.js
+++ b/devtools/client/animationinspector/test/head.js
@@ -335,17 +335,16 @@ function* clickTimelineRewindButton(pane
 /**
  * Select a rate inside the playback rate selector in the timeline toolbar and
  * wait for animations to update.
  * @param {AnimationsPanel} panel
  * @param {Number} rate The new rate value to be selected
  */
 function* changeTimelinePlaybackRate(panel, rate) {
   let onUiUpdated = panel.once(panel.UI_UPDATED_EVENT);
-  let onRendered = waitForAnimationTimelineRendering(panel);
 
   let select = panel.rateSelectorEl.firstChild;
   let win = select.ownerDocument.defaultView;
 
   // Get the right option.
   let option = [...select.options].filter(o => o.value === rate + "")[0];
   if (!option) {
     ok(false,
@@ -354,17 +353,17 @@ function* changeTimelinePlaybackRate(pan
     return;
   }
 
   // Simulate the right events to select the option in the drop-down.
   EventUtils.synthesizeMouseAtCenter(select, {type: "mousedown"}, win);
   EventUtils.synthesizeMouseAtCenter(option, {type: "mouseup"}, win);
 
   yield onUiUpdated;
-  yield onRendered;
+  yield waitForAnimationTimelineRendering(panel);
   yield waitForAllAnimationTargets(panel);
 
   // Simulate a mousemove outside of the rate selector area to avoid subsequent
   // tests from failing because of unwanted mouseover events.
   EventUtils.synthesizeMouseAtCenter(
     win.document.querySelector("#timeline-toolbar"), {type: "mousemove"}, win);
 }
 
@@ -375,17 +374,17 @@ function* changeTimelinePlaybackRate(pan
 function* waitForAnimationSelecting(panel) {
   yield panel.animationsTimelineComponent.once("animation-selected");
 }
 
 /**
  * Wait for rendering animation timeline.
  * @param {AnimationsPanel} panel
  */
-function* waitForAnimationTimelineRendering(panel) {
+function waitForAnimationTimelineRendering(panel) {
   return panel.animationsTimelineComponent.once("animation-timeline-rendering-completed");
 }
 
 /**
    + * Click the timeline header to update the animation current time.
    + * @param {AnimationsPanel} panel
    + * @param {Number} x position rate on timeline header.
    + *                 This method calculates