Bug 1544749 - Use toolbox.topWindow in devtools tests relying on toolbox.win.top/parent r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 18 Apr 2019 09:06:23 +0000
changeset 470042 51423343879f6ea29b96b2c3506cc2fb3fd16e60
parent 470041 f71f9d2fa72baeebe80e0c44e167e35bed04aa59
child 470043 5982eef0c2cb7ca74ab2461b5601cad68caf49c4
push id112839
push userapavel@mozilla.com
push dateThu, 18 Apr 2019 21:50:57 +0000
treeherdermozilla-inbound@e0a826fcd85b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1544749
milestone68.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 1544749 - Use toolbox.topWindow in devtools tests relying on toolbox.win.top/parent r=daisuke Depends on D27677 Update tests directly referencing toolbox.win.top/parent. Differential Revision: https://phabricator.services.mozilla.com/D27680
devtools/client/framework/test/browser_toolbox_toggle.js
devtools/client/framework/test/head.js
devtools/client/webconsole/test/mochitest/browser_webconsole_location_scratchpad_link.js
devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_scratchpad_link.js
--- a/devtools/client/framework/test/browser_toolbox_toggle.js
+++ b/devtools/client/framework/test/browser_toolbox_toggle.js
@@ -78,17 +78,17 @@ async function testToggleDetachedToolbox
 
   const onMainWindowFocus = once(window, "focus");
   window.focus();
   await onMainWindowFocus;
   ok(true, "Main window focused");
 
   info("Verify windowed toolbox is focused instead of closed when using " +
     "toggle key from the main window");
-  const toolboxWindow = toolbox.win.top;
+  const toolboxWindow = toolbox.topWindow;
   const onToolboxWindowFocus = once(toolboxWindow, "focus", true);
   EventUtils.synthesizeKey(key, modifiers);
   await onToolboxWindowFocus;
   ok(true, "Toolbox focused and not destroyed");
 
   info("Verify windowed toolbox is destroyed when using toggle key from its " +
     "own window");
 
--- a/devtools/client/framework/test/head.js
+++ b/devtools/client/framework/test/head.js
@@ -362,17 +362,17 @@ function getElementByToolId(toolbox, id)
 }
 
 function getElementByToolIdOrExtensionIdOrSelector(toolbox, idOrSelector) {
   const tabEl = getElementByToolId(toolbox, idOrSelector);
   return tabEl ? tabEl : toolbox.doc.querySelector(idOrSelector);
 }
 
 function getWindow(toolbox) {
-  return toolbox.win.parent;
+  return toolbox.topWindow;
 }
 
 async function resizeWindow(toolbox, width, height) {
   const hostWindow = toolbox.win.parent;
   const originalWidth = hostWindow.outerWidth;
   const originalHeight = hostWindow.outerHeight;
   const toWidth = width || originalWidth;
   const toHeight = height || originalHeight;
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_location_scratchpad_link.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_location_scratchpad_link.js
@@ -45,11 +45,11 @@ add_task(async function() {
   });
 
   EventUtils.synthesizeMouse(anchor, 2, 2, {}, hud.iframeWindow);
   await onScratchpadSelected;
 
   is(toolbox.getCurrentPanel(), scratchpadPanel,
     "Clicking link switches to Scratchpad panel");
 
-  is(Services.ww.activeWindow, toolbox.win.parent,
+  is(Services.ww.activeWindow, toolbox.topWindow,
      "Scratchpad's toolbox is focused");
 });
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_scratchpad_link.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_scratchpad_link.js
@@ -50,10 +50,10 @@ add_task(async function() {
   const onScratchpadSelected = toolbox.once("scratchpad-selected");
 
   EventUtils.sendMouseEvent({ type: "mousedown" }, anchor);
   await onScratchpadSelected;
 
   is(toolbox.getCurrentPanel(), scratchpadPanel,
     "Clicking link in stacktrace switches to Scratchpad panel");
 
-  is(Services.ww.activeWindow, toolbox.win.parent, "Scratchpad's toolbox is focused");
+  is(Services.ww.activeWindow, toolbox.topWindow, "Scratchpad's toolbox is focused");
 });