Bug 1443319 - Remove unnecessary generator on waitForAnimationTimelineRendering r=ochameau
- Fixes failing test
MozReview-Commit-ID: CvXrdcCZBsN
--- 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