Bug 1538731 - Add test for panel reloading with about:devtools-toolbox;r=daisuke
☠☠ backed out by 54e502f0f78e ☠ ☠
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 11 Apr 2019 09:52:47 +0000
changeset 468974 ff05581f5fe0125940697e9e3332bd84481dad98
parent 468973 769d9b3bdd4e5c5706744867d79171a092d3fcee
child 468975 f1615630af59478b0c08764d96e3268b2cbeeeb8
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1538731
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 1538731 - Add test for panel reloading with about:devtools-toolbox;r=daisuke Depends on D26899 This test would timeout with the fix in the previous patch Differential Revision: https://phabricator.services.mozilla.com/D26900
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
devtools/client/aboutdebugging-new/test/browser/head.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js
@@ -1,36 +1,57 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+// Test can run for a long time on debug platforms.
+requestLongerTimeout(5);
+
 /* import-globals-from helper-collapsibilities.js */
 Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
 
+const TOOLS = [
+  "inspector",
+  "webconsole",
+  "jsdebugger",
+  "styleeditor",
+  "performance",
+  "memory",
+  "netmonitor",
+  "storage",
+  "accessibility",
+];
+
 /**
  * Test whether about:devtools-toolbox display correctly after reloading.
  */
 add_task(async function() {
   info("Force all debug target panes to be expanded");
   prepareCollapsibilitiesTest();
 
+  for (const toolId of TOOLS) {
+    await testReloadAboutDevToolsToolbox(toolId);
+  }
+});
+
+async function testReloadAboutDevToolsToolbox(toolId) {
   const { document, tab, window } = await openAboutDebugging();
   await selectThisFirefoxPage(document, window.AboutDebugging.store);
   const { devtoolsBrowser, devtoolsTab, devtoolsWindow } =
     await openAboutDevtoolsToolbox(document, tab, window);
 
-  info("Select webconsole tool");
+  info(`Select tool: ${toolId}`);
   const toolbox = getToolbox(devtoolsWindow);
-  await toolbox.selectTool("webconsole");
+  await toolbox.selectTool(toolId);
 
   info("Reload about:devtools-toolbox page");
   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(document, devtoolsTab, window);
   await removeTab(tab);
-});
+}
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -94,23 +94,30 @@ async function openAboutDevtoolsToolbox(
     devtoolsTab,
     devtoolsWindow: devtoolsBrowser.contentWindow,
   };
 }
 
 async function closeAboutDevtoolsToolbox(aboutDebuggingDocument, devtoolsTab, win) {
   info("Close about:devtools-toolbox page");
   const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
+
+  info("Wait for removeTab");
   await removeTab(devtoolsTab);
+
+  info("Wait for toolbox destroyed");
   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.
+  info("Wait until aboutdebugging is selected");
   await waitUntil(() => gBrowser.selectedTab !== devtoolsTab);
 
   // Wait for removing about:devtools-toolbox tab info from about:debugging.
+  info("Wait until about:devtools-toolbox is removed from debug targets");
   await waitUntil(() =>
     !findDebugTargetByText("about:devtools-toolbox?", aboutDebuggingDocument));
 
   await waitForRequestsToSettle(win.AboutDebugging.store);
 }
 
 async function reloadAboutDebugging(tab) {
   info("reload about:debugging");