Backed out 2 changesets (bug 1507125) for ESlint failure on runtimes.js . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 28 Nov 2018 19:58:15 +0200
changeset 504988 eefaa80b67451e8213c63421a7cbccc2824513dd
parent 504987 da3635436bf11b00795861958e251249a8fe005c
child 504989 d943368c547a12ec273f0d71b21ddc90e1ff3062
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1507125
milestone65.0a1
backs out2b9aaf2f3b58ee8d39ce4d4b2c4f4c935894d030
641de22d6480c8656b5dc6371c57f8b666771c19
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 2 changesets (bug 1507125) for ESlint failure on runtimes.js . CLOSED TREE Backed out changeset 2b9aaf2f3b58 (bug 1507125) Backed out changeset 641de22d6480 (bug 1507125)
devtools/client/aboutdebugging-new/src/actions/runtimes.js
devtools/client/aboutdebugging-new/test/browser/browser.ini
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtools.js
devtools/server/tests/unit/test_front_destroy.js
devtools/server/tests/unit/xpcshell.ini
devtools/shared/protocol.js
--- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js
+++ b/devtools/client/aboutdebugging-new/src/actions/runtimes.js
@@ -110,16 +110,20 @@ function disconnectRuntime(id) {
       const { clientWrapper } = runtime.runtimeDetails;
 
       if (runtime.type === RUNTIMES.USB) {
         clientWrapper.removeListener("closed", onUSBDebuggerClientClosed);
       }
 
       await clientWrapper.close();
 
+      if (runtime.type === RUNTIMES.THIS_FIREFOX) {
+        DebuggerServer.destroy();
+      }
+
       dispatch({
         type: DISCONNECT_RUNTIME_SUCCESS,
         runtime: {
           id,
           type: runtime.type,
         },
       });
     } catch (e) {
--- a/devtools/client/aboutdebugging-new/test/browser/browser.ini
+++ b/devtools/client/aboutdebugging-new/test/browser/browser.ini
@@ -21,17 +21,16 @@ support-files =
 [browser_aboutdebugging_connect_networklocations.js]
 [browser_aboutdebugging_connect_toggle_usb_devices.js]
 skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug 1499638
 [browser_aboutdebugging_connection_prompt_setting.js]
 [browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js]
 [browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js]
 [browser_aboutdebugging_debug-target-pane_empty.js]
 [browser_aboutdebugging_debug-target-pane_usb_runtime.js]
-[browser_aboutdebugging_devtools.js]
 [browser_aboutdebugging_navigate.js]
 [browser_aboutdebugging_persist_connection.js]
 [browser_aboutdebugging_routes.js]
 [browser_aboutdebugging_sidebar_network_runtimes.js]
 [browser_aboutdebugging_sidebar_usb_runtime.js]
 [browser_aboutdebugging_sidebar_usb_runtime_connect.js]
 [browser_aboutdebugging_sidebar_usb_runtime_refresh.js]
 [browser_aboutdebugging_sidebar_usb_status.js]
deleted file mode 100644
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_devtools.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Check that DevTools are not closed when leaving This Firefox runtime page.
- */
-
-add_task(async function() {
-  info("Force all debug target panes to be expanded");
-  prepareCollapsibilitiesTest();
-
-  const { document, tab, window } = await openAboutDebugging();
-
-  const connectSidebarItem = findSidebarItemByText("Connect", document);
-  const connectLink = connectSidebarItem.querySelector(".js-sidebar-link");
-  ok(connectSidebarItem, "Found the Connect sidebar item");
-
-  info("Open devtools on the current about:debugging tab");
-  const toolbox = await openToolboxForTab(tab, "inspector");
-  const inspector = toolbox.getPanel("inspector");
-
-  info("DevTools starts workers, wait for requests to settle");
-  const store = window.AboutDebugging.store;
-  await waitForDispatch(store, "REQUEST_WORKERS_SUCCESS");
-  await waitForRequestsToSettle(store);
-
-  info("Click on the Connect item in the sidebar");
-  connectLink.click();
-  await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS");
-
-  info("Wait until Connect page is displayed");
-  await waitUntil(() => document.querySelector(".js-connect-page"));
-
-  const markupViewElement = inspector.panelDoc.getElementById("markup-box");
-  ok(markupViewElement, "Inspector is still rendered");
-
-  await removeTab(tab);
-});
deleted file mode 100644
--- a/devtools/server/tests/unit/test_front_destroy.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that fronts throw errors if they are called after being destroyed.
- */
-
-"use strict";
-
-add_task(async function test() {
-  DebuggerServer.init();
-  DebuggerServer.registerAllActors();
-
-  info("Create and connect the DebuggerClient");
-  const transport = DebuggerServer.connectPipe();
-  const client = new DebuggerClient(transport);
-  await client.connect();
-
-  info("Get the device front and check calling getDescription() on it");
-  const front = await client.mainRoot.getFront("device");
-  const description = await front.getDescription();
-  ok(!!description, "Check that the getDescription() method returns a valid response.");
-
-  info("Destroy the device front and try calling getDescription again");
-  front.destroy();
-  Assert.throws(() => front.getDescription(),
-    /Can not send request because front 'device' is already destroyed\./,
-    "Check device front throws when getDescription() is called after destroy()");
-
-  await client.close();
-});
--- a/devtools/server/tests/unit/xpcshell.ini
+++ b/devtools/server/tests/unit/xpcshell.ini
@@ -78,17 +78,16 @@ skip-if = (verify && !debug && (os == 'w
 [test_threadlifetime-02.js]
 [test_threadlifetime-03.js]
 [test_threadlifetime-04.js]
 [test_threadlifetime-05.js]
 [test_threadlifetime-06.js]
 [test_functiongrips-01.js]
 [test_frameclient-01.js]
 [test_frameclient-02.js]
-[test_front_destroy.js]
 [test_nativewrappers.js]
 [test_nodelistactor.js]
 [test_eval-01.js]
 [test_eval-02.js]
 [test_eval-03.js]
 [test_eval-04.js]
 [test_eval-05.js]
 [test_format_command.js]
--- a/devtools/shared/protocol.js
+++ b/devtools/shared/protocol.js
@@ -1354,30 +1354,24 @@ Front.prototype = extend(Pool.prototype,
    * Subclasses should override this.
    */
   form: function(form) {},
 
   /**
    * Send a packet on the connection.
    */
   send: function(packet) {
-    if (!packet.to) {
+    if (packet.to) {
+      this.conn._transport.send(packet);
+    } else {
       packet.to = this.actorID;
-    }
-
-    // If packet.to and this.actorID are not available, the request will not be able to
-    // complete. The front was probably destroyed earlier.
-    if (!packet.to) {
-      throw new Error(
-        `Can not send request because front '${this.typeName}' is already destroyed.`);
-    }
-
-    // The connection might be closed during the promise resolution
-    if (this.conn._transport) {
-      this.conn._transport.send(packet);
+      // The connection might be closed during the promise resolution
+      if (this.conn._transport) {
+        this.conn._transport.send(packet);
+      }
     }
   },
 
   /**
    * Send a two-way request on the connection.
    */
   request: function(packet) {
     const deferred = defer();