Bug 1454123 - Wait a moment after moving toolbox to a window before triggering its menu; r?bgrins
MozReview-Commit-ID: 839Z65WTjpC
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_split.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_split.js
@@ -24,16 +24,24 @@ add_task(async function() {
info("Testing host types");
checkHostType(Toolbox.HostType.BOTTOM);
checkToolboxUI();
await toolbox.switchHost(Toolbox.HostType.SIDE);
checkHostType(Toolbox.HostType.SIDE);
checkToolboxUI();
await toolbox.switchHost(Toolbox.HostType.WINDOW);
+
+ // checkHostType, below, will open the meatball menu to read the "Split
+ // console" menu item label. However, if we've just opened a new window then
+ // on some platforms when we switch focus to the new window we might end up
+ // triggering the auto-close behavior on the menu popup. To avoid that, wait
+ // a moment before querying the menu.
+ await new Promise(resolve => requestIdleCallback(resolve));
+
checkHostType(Toolbox.HostType.WINDOW);
checkToolboxUI();
await toolbox.switchHost(Toolbox.HostType.BOTTOM);
async function testConsoleLoadOnDifferentPanel() {
info("About to check console loads even when non-webconsole panel is open");
await openPanel("inspector");