Bug 1454123 - Wait a moment after moving toolbox to a window before triggering its menu; r=bgrins
authorBrian Birtles <birtles@gmail.com>
Wed, 25 Apr 2018 09:55:04 +0900
changeset 471772 595101eb4739f648080e23c5561ff27eb812a4cd
parent 471771 3e771c2f48b037b8fa9b6be2c4634e8debd2a2d1
child 471773 3010f9088dc76ba9d1918ab6fd5a5aaf24436a42
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1454123
milestone61.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 1454123 - Wait a moment after moving toolbox to a window before triggering its menu; r=bgrins MozReview-Commit-ID: 839Z65WTjpC
devtools/client/webconsole/test/mochitest/browser_webconsole_split.js
--- 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");