Backed out changeset b147830dc59e (bug 1505368) for devtools node failures. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Thu, 04 Apr 2019 14:24:41 +0300
changeset 467954 2c261b95d855b3f61595342fdce6cd64fd1f1cc1
parent 467953 09132ad821801ba248d199cfa3342b39b7d8c98b
child 467955 2f0524895cf33bbac0547c3d0a2ff494b9ab8008
push id35813
push useraiakab@mozilla.com
push dateThu, 04 Apr 2019 16:07:30 +0000
treeherdermozilla-central@aa623df2ae8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1505368
milestone68.0a1
backs outb147830dc59ed33e2cf9973e211e8547590807d3
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
Backed out changeset b147830dc59e (bug 1505368) for devtools node failures. CLOSED TREE
devtools/client/aboutdebugging-new/test/browser/browser.ini
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js
devtools/client/framework/components/DebugTargetInfo.js
devtools/client/framework/toolbox-init.js
devtools/client/framework/toolbox.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser.ini
+++ b/devtools/client/aboutdebugging-new/test/browser/browser.ini
@@ -54,18 +54,16 @@ skip-if = (os == 'linux' && bits == 32) 
 [browser_aboutdebugging_debug-target-pane_usb_runtime.js]
 [browser_aboutdebugging_devtools.js]
 [browser_aboutdebugging_devtoolstoolbox_contextmenu.js]
 [browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js]
 [browser_aboutdebugging_devtoolstoolbox_menubar.js]
 [browser_aboutdebugging_devtoolstoolbox_reload.js]
 [browser_aboutdebugging_devtoolstoolbox_shortcuts.js]
 skip-if = (os == "win" && ccov) # Bug 1521349
-[browser_aboutdebugging_devtoolstoolbox_target_destroyed.js]
-skip-if = debug || asan # This test leaks. See bug 1529005
 [browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js]
 [browser_aboutdebugging_navigate.js]
 [browser_aboutdebugging_persist_connection.js]
 [browser_aboutdebugging_process_category.js]
 [browser_aboutdebugging_process_main.js]
 [browser_aboutdebugging_profiler_dialog.js]
 [browser_aboutdebugging_real_usb_runtime_page_runtime_info.js]
 [browser_aboutdebugging_real_usb_sidebar.js]
deleted file mode 100644
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that the expected supported categories are displayed for USB runtimes.
-add_task(async function() {
-  const targetTab = await addTab("about:home");
-
-  const { document, tab, window } = await openAboutDebugging();
-
-  // go to This Firefox and inspect the new tab
-  info("Inspecting a new tab in This Firefox");
-  await selectThisFirefoxPage(document, window.AboutDebugging.store);
-  const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
-    await openAboutDevtoolsToolbox(document, tab, window, "about:home");
-  const targetInfoHeader = devtoolsDocument.querySelector(".js-debug-target-info");
-  ok(targetInfoHeader.textContent.includes("about:home"),
-    "about:devtools-toolbox is open for the target");
-
-  // close the inspected tab and check that error page is shown
-  info("removing the inspected tab");
-  await removeTab(targetTab);
-  await waitUntil(() => devtoolsWindow.document.querySelector(".js-error-page"));
-
-  info("closing the toolbox");
-  await removeTab(devtoolsTab);
-  info("removing about:debugging tab");
-  await removeTab(tab);
-});
--- a/devtools/client/framework/components/DebugTargetInfo.js
+++ b/devtools/client/framework/components/DebugTargetInfo.js
@@ -111,17 +111,17 @@ class DebugTargetInfo extends PureCompon
       title ? dom.b({ className: "devtools-ellipsis-text js-target-title"}, title) : null,
       dom.span({ className: "devtools-ellipsis-text" }, url),
     );
   }
 
   render() {
     return dom.header(
       {
-        className: "debug-target-info js-debug-target-info",
+        className: "debug-target-info",
       },
       this.shallRenderConnection() ? this.renderConnection() : null,
       this.renderRuntime(),
       this.renderTarget(),
     );
   }
 }
 
--- a/devtools/client/framework/toolbox-init.js
+++ b/devtools/client/framework/toolbox-init.js
@@ -115,19 +115,12 @@ async function initToolbox(url, host) {
     // When an error occurs, show error page with message.
     console.error("Exception while loading the toolbox", error);
     showErrorPage(host.contentDocument, `${error}`);
   }
 }
 
 // Only use this method to attach the toolbox if some query parameters are given
 if (url.search.length > 1) {
-  // show error page if 'disconnected' param appears in the querystring
-  if (url.searchParams.has("disconnected")) {
-    const error = new Error("Debug target was disconnected");
-    showErrorPage(host.contentDocument, `${error}`);
-  // otherwise, try to init the toolbox
-  } else {
-    initToolbox(url, host);
-  }
+  initToolbox(url, host);
 }
 // TODO: handle no params in about:devtool-toolbox
 // https://bugzilla.mozilla.org/show_bug.cgi?id=1526996
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -163,28 +163,27 @@ function Toolbox(target, selectedTool, h
   this._onPickerKeypress = this._onPickerKeypress.bind(this);
   this._onPickerStarting = this._onPickerStarting.bind(this);
   this._onPickerStarted = this._onPickerStarted.bind(this);
   this._onPickerStopped = this._onPickerStopped.bind(this);
   this._onPickerCanceled = this._onPickerCanceled.bind(this);
   this._onInspectObject = this._onInspectObject.bind(this);
   this._onNewSelectedNodeFront = this._onNewSelectedNodeFront.bind(this);
   this._onToolSelected = this._onToolSelected.bind(this);
-  this._onTargetClosed = this._onTargetClosed.bind(this);
   this.updateToolboxButtonsVisibility = this.updateToolboxButtonsVisibility.bind(this);
   this.updateToolboxButtons = this.updateToolboxButtons.bind(this);
   this.selectTool = this.selectTool.bind(this);
   this._pingTelemetrySelectTool = this._pingTelemetrySelectTool.bind(this);
   this.toggleSplitConsole = this.toggleSplitConsole.bind(this);
   this.toggleOptions = this.toggleOptions.bind(this);
   this.togglePaintFlashing = this.togglePaintFlashing.bind(this);
   this.toggleDragging = this.toggleDragging.bind(this);
   this.isPaintFlashing = false;
 
-  this._target.on("close", this._onTargetClosed);
+  this._target.on("close", this.destroy);
 
   if (!selectedTool) {
     selectedTool = Services.prefs.getCharPref(this._prefs.LAST_TOOL);
   }
   this._defaultToolId = selectedTool;
 
   this._hostType = hostType;
 
@@ -610,31 +609,16 @@ Toolbox.prototype = {
   _getDeviceDescription: async function() {
     const deviceFront = await this.target.client.mainRoot.getFront("device");
     const description = await deviceFront.getDescription();
     const remoteId = new this.win.URLSearchParams(this.win.location.href).get("remoteId");
     const connectionType = remoteClientManager.getConnectionTypeByRemoteId(remoteId);
     return Object.assign({}, description, { connectionType });
   },
 
-  _onTargetClosed: async function() {
-    const win = this.win; // .destroy() will set this.win to null
-
-    // clean up the toolbox
-    this.destroy();
-    // NOTE: we should await this.destroy() to ensure a proper clean up.
-    //       See https://bugzilla.mozilla.org/show_bug.cgi?id=1536144
-
-    // redirect to about:toolbox error page if we are connected to a remote
-    // target and we lose it
-    if (this.hostType === Toolbox.HostType.PAGE) {
-      win.location.replace("about:devtools-toolbox?disconnected");
-    }
-  },
-
   /**
    * loading React modules when needed (to avoid performance penalties
    * during Firefox start up time).
    */
   get React() {
     return this.browserRequire("devtools/client/shared/vendor/react");
   },
 
@@ -3076,17 +3060,17 @@ Toolbox.prototype = {
           // This is done after other destruction tasks since it may tear down
           // fronts and the debugger transport which earlier destroy methods may
           // require to complete.
           if (!this._target) {
             return null;
           }
           const target = this._target;
           this._target = null;
-          target.off("close", this._onTargetClosed);
+          target.off("close", this.destroy);
           return target.destroy();
         }, console.error).then(() => {
           this.emit("destroyed");
 
           // Free _host after the call to destroyed in order to let a chance
           // to destroyed listeners to still query toolbox attributes
           this._host = null;
           this._win = null;