Bug 1528140: Wait for removing about:devtools-toolbox tab info from about:debugging. r=ladybenko
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 12 Mar 2019 14:28:13 +0000
changeset 521628 ebdf6023eb76
parent 521627 ca44b5f0bb41
child 521629 e4c0a53fd80d
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersladybenko
bugs1528140
milestone67.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 1528140: Wait for removing about:devtools-toolbox tab info from about:debugging. r=ladybenko Differential Revision: https://phabricator.services.mozilla.com/D23105
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js
devtools/client/aboutdebugging-new/test/browser/head.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js
@@ -23,17 +23,17 @@ add_task(async function() {
   await assertContextMenu(rootDocument, devtoolsBrowser,
                           ".debug-target-info", false);
 
   info("Force to select about:debugging page");
   gBrowser.selectedTab = tab;
   info("Check whether the menu item which opens devtools is enabled");
   await assertContextMenu(rootDocument, devtoolsBrowser, "#mount", true);
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
 
 async function assertContextMenu(rootDocument, browser, targetSelector, shouldBeEnabled) {
   if (shouldBeEnabled) {
     await assertContextMenuEnabled(rootDocument, browser, targetSelector);
   } else {
     await assertContextMenuDisabled(rootDocument, browser, targetSelector);
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js
@@ -27,11 +27,11 @@ add_task(async function() {
   EventUtils.synthesizeMouseAtCenter(markupDocument.body,
                                      { type: "contextmenu" },
                                      markupDocument.ownerGlobal);
 
   info("Check whether proper context menu of markup view will be shown");
   await waitUntil(() => devtoolsDocument.querySelector("#node-menu-edithtml"));
   ok(true, "Context menu of markup view should be shown");
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js
@@ -21,17 +21,17 @@ add_task(async function() {
   const rootDocument = devtoolsTab.ownerDocument;
   await assertMenusItems(rootDocument, false);
 
   info("Force to select about:debugging page");
   gBrowser.selectedTab = tab;
   info("Check whether the menu items are enabled");
   await assertMenusItems(rootDocument, true);
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
 
 async function assertMenusItems(rootDocument, shouldBeEnabled) {
   const menuItem = rootDocument.getElementById("menu_devToolbox");
   // Wait for hidden attribute changed since the menu items will update asynchronously.
   await waitUntil(() => menuItem.hidden === !shouldBeEnabled);
 
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
@@ -26,11 +26,11 @@ add_task(async function() {
   devtoolsBrowser.reload();
   await gDevTools.once("toolbox-ready");
   ok(true, "Toolbox is re-created again");
 
   info("Check whether about:devtools-toolbox page displays correctly");
   ok(devtoolsBrowser.contentDocument.querySelector(".debug-target-info"),
      "about:devtools-toolbox page displays correctly");
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js
@@ -21,17 +21,17 @@ add_task(async function() {
   info("Check whether the shortcut keys which opens devtools is disabled");
   await assertShortcutKeys(devtoolsBrowser, false);
 
   info("Force to select about:debugging page");
   gBrowser.selectedTab = tab;
   info("Check whether the shortcut keys which opens devtools is enabled");
   await assertShortcutKeys(tab.linkedBrowser, true);
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
 
 async function assertShortcutKeys(browser, shouldBeEnabled) {
   await assertShortcutKey(browser.contentWindow, "VK_F12", {}, shouldBeEnabled);
   await assertShortcutKey(browser.contentWindow, "I", {
     accelKey: true,
     shiftKey: !navigator.userAgent.match(/Mac/),
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js
@@ -33,17 +33,17 @@ add_task(async function() {
   await checkTooltipVisibility(
     inspector, eventBadge, devtoolsDocument.querySelector(".debug-target-info"));
 
   info("Check tooltip visibility after clicking on an element in the root document");
   const rootDocument = devtoolsWindow.windowRoot.ownerGlobal.document;
   await checkTooltipVisibility(
     inspector, eventBadge, rootDocument.querySelector("#titlebar"));
 
-  await closeAboutDevtoolsToolbox(devtoolsTab, window);
+  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
   await removeTab(tab);
 });
 
 async function checkTooltipVisibility(inspector, elementForShowing, elementForHiding) {
   info("Show event tooltip");
   elementForShowing.click();
   const tooltip = inspector.markup.eventDetailsTooltip;
   await tooltip.once("shown");
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -85,24 +85,29 @@ async function openAboutDevtoolsToolbox(
   return {
     devtoolsBrowser,
     devtoolsDocument: devtoolsBrowser.contentDocument,
     devtoolsTab,
     devtoolsWindow: devtoolsBrowser.contentWindow,
   };
 }
 
-async function closeAboutDevtoolsToolbox(devtoolsTab, win) {
+async function closeAboutDevtoolsToolbox(aboutDebuggingDocument, devtoolsTab, win) {
   info("Close about:devtools-toolbox page");
   const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
   await removeTab(devtoolsTab);
   await onToolboxDestroyed;
   // Changing the tab will also trigger a request to list tabs, so wait until the selected
   // tab has changed to wait for requests to settle.
   await waitUntil(() => gBrowser.selectedTab !== devtoolsTab);
+
+  // Wait for removing about:devtools-toolbox tab info from about:debugging.
+  await waitUntil(() =>
+    !findDebugTargetByText("about:devtools-toolbox?", aboutDebuggingDocument));
+
   await waitForRequestsToSettle(win.AboutDebugging.store);
 }
 
 async function reloadAboutDebugging(tab) {
   info("reload about:debugging");
 
   await refreshTab(tab);
   const browser = tab.linkedBrowser;