Bug 1276873 - Wait for a tick to avoid unexpected popuphidden event; r=jryans
authorJan Odvarko <odvarko@gmail.com>
Thu, 02 Jun 2016 13:33:14 +0200
changeset 375175 f4fbac42bc5e86aeb36fb2d4157fa6dbcf4e441e
parent 375144 0ef7cc6b42c72be6ef8d0786fb1f5371c11e9e32
child 375176 be6fddfc1390a14cd560eb843162f0cccd804e63
push id20186
push userrhelmer@mozilla.com
push dateFri, 03 Jun 2016 16:55:36 +0000
reviewersjryans
bugs1276873
milestone49.0a1
Bug 1276873 - Wait for a tick to avoid unexpected popuphidden event; r=jryans
devtools/client/framework/test/browser_toolbox_window_title_frame_select.js
devtools/client/inspector/test/browser_inspector_highlighter-iframes_02.js
devtools/client/inspector/test/browser_inspector_select-docshell.js
devtools/client/webaudioeditor/test/browser_wa_reset-04.js
--- a/devtools/client/framework/test/browser_toolbox_window_title_frame_select.js
+++ b/devtools/client/framework/test/browser_toolbox_window_title_frame_select.js
@@ -25,23 +25,27 @@ add_task(function* () {
     Toolbox.HostType.BOTTOM);
 
   yield toolbox.selectTool("inspector");
   yield toolbox.switchHost(Toolbox.HostType.WINDOW);
 
   is(getTitle(), `Developer Tools - Page title - ${URL}`,
     "Devtools title correct after switching to detached window host");
 
+  // Wait for tick to avoid unexpected 'popuphidden' event, which
+  // blocks the frame popup menu opened below. See also bug 1276873
+  yield waitForTick();
+
   // Open frame menu and wait till it's available on the screen.
   let btn = toolbox.doc.getElementById("command-button-frames");
   let menu = toolbox.showFramesMenu({target: btn});
   yield once(menu, "open");
 
   // Verify that the frame list menu is populated
-  let frames = menu.menuitems;
+  let frames = menu.items;
   is(frames.length, 2, "We have both frames in the list");
 
   let topFrameBtn = frames.filter(b => b.label == URL)[0];
   let iframeBtn = frames.filter(b => b.label == IFRAME_URL)[0];
   ok(topFrameBtn, "Got top level document in the list");
   ok(iframeBtn, "Got iframe document in the list");
 
   // Listen to will-navigate to check if the view is empty
--- a/devtools/client/inspector/test/browser_inspector_highlighter-iframes_02.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-iframes_02.js
@@ -45,15 +45,15 @@ function* switchToFrameContext(frameInde
   // Open frame menu and wait till it's available on the screen.
   let btn = toolbox.doc.getElementById("command-button-frames");
   let menu = toolbox.showFramesMenu({target: btn});
   yield once(menu, "open");
 
   info("Select the iframe in the frame list.");
   let newRoot = inspector.once("new-root");
 
-  menu.menuitems[frameIndex].click();
+  menu.items[frameIndex].click();
 
   yield newRoot;
   yield inspector.once("inspector-updated");
 
   info("Navigation to the iframe is done.");
 }
--- a/devtools/client/inspector/test/browser_inspector_select-docshell.js
+++ b/devtools/client/inspector/test/browser_inspector_select-docshell.js
@@ -28,17 +28,17 @@ add_task(function* () {
   let btn = toolbox.doc.getElementById("command-button-frames");
   ok(!btn.firstChild, "The frame list button doesn't have any children");
 
   // Open frame menu and wait till it's available on the screen.
   let menu = toolbox.showFramesMenu({target: btn});
   yield once(menu, "open");
 
   // Verify that the menu is popuplated.
-  let frames = menu.menuitems.slice();
+  let frames = menu.items.slice();
   is(frames.length, 2, "We have both frames in the menu");
 
   frames.sort(function (a, b) {
     return a.label.localeCompare(b.label);
   });
 
   is(frames[0].label, FrameURL, "Got top level document in the list");
   is(frames[1].label, URL, "Got iframe document in the list");
--- a/devtools/client/webaudioeditor/test/browser_wa_reset-04.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_reset-04.js
@@ -27,17 +27,17 @@ add_task(function* () {
 
   let btn = toolbox.doc.getElementById("command-button-frames");
   ok(!btn.firstChild, "The frame list button has no children");
 
   // Open frame menu and wait till it's available on the screen.
   let menu = toolbox.showFramesMenu({target: btn});
   yield once(menu, "open");
 
-  let frames = menu.menuitems;
+  let frames = menu.items;
   is(frames.length, 2, "We have both frames in the list");
 
   // Select the iframe
   frames[1].click();
 
   let navigating = once(target, "will-navigate");
 
   yield navigating;