Backed out 7 changesets (bug 1497457) for devtools failure at devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js on a CLOSED TREE
authorDaniel Varga <dvarga@mozilla.com>
Tue, 27 Nov 2018 00:59:34 +0200
changeset 448138 a6eccac5baa2fce29837003e8de53e9f243a7df0
parent 448137 0a2f54a1a5ca4e1a14ed516fe4b7de2bf8d23a05
child 448139 9dcdb35839c5b2ea345118d2c109682ee1fb0831
push id35105
push userrmaries@mozilla.com
push dateTue, 27 Nov 2018 09:41:18 +0000
treeherdermozilla-central@b0e69b136883 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1497457
milestone65.0a1
backs outd3b46f3a0306aaf4dda9f47fb4f02bc66f3ba562
bd490139b395d47c6f1b4af6cf34f572a1902fe2
b2830500918c4bcef6bbbc794d1d70c0626b784b
9923755ee205175171873f87bacae7140fc5c35d
f2a39a18f2f602b230062c3e6735f80cf9d84272
95365a2d747034833ee6380f837f0fd600552ae9
0e93acc09952e559958991399bba7c11571343b4
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 7 changesets (bug 1497457) for devtools failure at devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js on a CLOSED TREE Backed out changeset d3b46f3a0306 (bug 1497457) Backed out changeset bd490139b395 (bug 1497457) Backed out changeset b2830500918c (bug 1497457) Backed out changeset 9923755ee205 (bug 1497457) Backed out changeset f2a39a18f2f6 (bug 1497457) Backed out changeset 95365a2d7470 (bug 1497457) Backed out changeset 0e93acc09952 (bug 1497457)
devtools/client/aboutdebugging-new/aboutdebugging.js
devtools/client/aboutdebugging-new/src/actions/debug-targets.js
devtools/client/aboutdebugging-new/src/actions/runtimes.js
devtools/client/aboutdebugging-new/src/modules/runtime-client-factory.js
devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
devtools/client/aboutdebugging-new/src/types/runtime.js
devtools/client/aboutdebugging-new/test/browser/browser.ini
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_persist_connection.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
devtools/client/aboutdebugging-new/test/browser/head.js
devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-mocks.js
devtools/client/framework/target-from-url.js
devtools/client/shared/moz.build
devtools/client/shared/remote-debugging/moz.build
devtools/client/shared/remote-debugging/remote-client-manager.js
devtools/shared/client/event-source.js
devtools/shared/tests/unit/test_eventsource.js
devtools/shared/tests/unit/xpcshell.ini
--- a/devtools/client/aboutdebugging-new/aboutdebugging.js
+++ b/devtools/client/aboutdebugging-new/aboutdebugging.js
@@ -94,19 +94,16 @@ const AboutDebugging = {
 
     l10n.destroy();
 
     const currentRuntimeId = state.runtimes.selectedRuntimeId;
     if (currentRuntimeId) {
       await this.actions.unwatchRuntime(currentRuntimeId);
     }
 
-    // Remove all client listeners.
-    this.actions.removeRuntimeListeners();
-
     removeNetworkLocationsObserver(this.onNetworkLocationsUpdated);
     removeUSBRuntimesObserver(this.onUSBRuntimesUpdated);
     disableUSBRuntimes();
     adbAddon.off("update", this.onAdbAddonUpdated);
     setDebugTargetCollapsibilities(state.ui.debugTargetCollapsibilities);
     unmountComponentAtNode(this.mount);
   },
 
--- a/devtools/client/aboutdebugging-new/src/actions/debug-targets.js
+++ b/devtools/client/aboutdebugging-new/src/actions/debug-targets.js
@@ -1,18 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
 const { gDevToolsBrowser } = require("devtools/client/framework/devtools-browser");
-const { remoteClientManager } =
-  require("devtools/client/shared/remote-debugging/remote-client-manager");
 
 const { l10n } = require("../modules/l10n");
 
 const {
   debugLocalAddon,
   debugRemoteAddon,
   openTemporaryExtension,
   uninstallAddon,
@@ -41,20 +39,19 @@ function inspectDebugTarget(type, id) {
   return async (_, getState) => {
     const runtime = getCurrentRuntime(getState().runtimes);
     const { runtimeDetails, type: runtimeType } = runtime;
 
     switch (type) {
       case DEBUG_TARGETS.TAB: {
         // Open tab debugger in new window.
         if (runtimeType === RUNTIMES.NETWORK || runtimeType === RUNTIMES.USB) {
-          // Pass the remote id from the client manager so that about:devtools-toolbox can
-          // retrieve the connected client directly.
-          const remoteId = remoteClientManager.getRemoteId(runtime.id, runtime.type);
-          window.open(`about:devtools-toolbox?type=tab&id=${id}&remoteId=${remoteId}`);
+          const { host, port } = runtimeDetails.transportDetails;
+          window.open(`about:devtools-toolbox?type=tab&id=${id}` +
+                      `&host=${host}&port=${port}`);
         } else if (runtimeType === RUNTIMES.THIS_FIREFOX) {
           window.open(`about:devtools-toolbox?type=tab&id=${id}`);
         }
         break;
       }
       case DEBUG_TARGETS.EXTENSION: {
         if (runtimeType === RUNTIMES.NETWORK || runtimeType === RUNTIMES.USB) {
           const devtoolsClient = runtimeDetails.clientWrapper.client;
--- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js
+++ b/devtools/client/aboutdebugging-new/src/actions/runtimes.js
@@ -11,19 +11,16 @@ const Actions = require("./index");
 const {
   getCurrentRuntime,
   findRuntimeById,
 } = require("../modules/runtimes-state-helper");
 const { isSupportedDebugTarget } = require("../modules/debug-target-support");
 
 const { createClientForRuntime } = require("../modules/runtime-client-factory");
 
-const { remoteClientManager } =
-  require("devtools/client/shared/remote-debugging/remote-client-manager");
-
 const {
   CONNECT_RUNTIME_FAILURE,
   CONNECT_RUNTIME_START,
   CONNECT_RUNTIME_SUCCESS,
   DEBUG_TARGETS,
   DISCONNECT_RUNTIME_FAILURE,
   DISCONNECT_RUNTIME_START,
   DISCONNECT_RUNTIME_SUCCESS,
@@ -66,25 +63,26 @@ function onUSBDebuggerClientClosed() {
   window.AboutDebugging.store.dispatch(Actions.scanUSBRuntimes());
 }
 
 function connectRuntime(id) {
   return async (dispatch, getState) => {
     dispatch({ type: CONNECT_RUNTIME_START });
     try {
       const runtime = findRuntimeById(id, getState().runtimes);
-      const clientWrapper = await createClientForRuntime(runtime);
+      const { clientWrapper, transportDetails } = await createClientForRuntime(runtime);
       const info = await getRuntimeInfo(runtime, clientWrapper);
 
       const promptPrefName = RUNTIME_PREFERENCE.CONNECTION_PROMPT;
       const connectionPromptEnabled = await clientWrapper.getPreference(promptPrefName);
       const runtimeDetails = {
         clientWrapper,
         connectionPromptEnabled,
         info,
+        transportDetails,
       };
 
       if (runtime.type === RUNTIMES.USB) {
         // `closed` event will be emitted when disabling remote debugging
         // on the connected USB runtime.
         clientWrapper.addOneTimeListener("closed", onUSBDebuggerClientClosed);
       }
 
@@ -225,45 +223,19 @@ function updateUSBRuntimes(runtimes) {
     const existingRuntimes = getState().runtimes.usbRuntimes;
     const invalidRuntimes = existingRuntimes.filter(r => !validIds.includes(r.id));
 
     for (const invalidRuntime of invalidRuntimes) {
       await dispatch(disconnectRuntime(invalidRuntime.id));
     }
 
     dispatch({ type: USB_RUNTIMES_UPDATED, runtimes });
-
-    for (const runtime of getState().runtimes.usbRuntimes) {
-      const isConnected = !!runtime.runtimeDetails;
-      const hasConnectedClient = remoteClientManager.hasClient(runtime.id, runtime.type);
-      if (!isConnected && hasConnectedClient) {
-        await dispatch(connectRuntime(runtime.id));
-      }
-    }
-  };
-}
-
-/**
- * Remove all the listeners added on client objects. Since those objects are persisted
- * regardless of the about:debugging lifecycle, all the added events should be removed
- * before leaving about:debugging.
- */
-function removeRuntimeListeners() {
-  return (dispatch, getState) => {
-    const { usbRuntimes } = getState().runtimes;
-    for (const runtime of usbRuntimes) {
-      if (runtime.runtimeDetails) {
-        const { clientWrapper } = runtime.runtimeDetails;
-        clientWrapper.removeListener("closed", onUSBDebuggerClientClosed);
-      }
-    }
   };
 }
 
 module.exports = {
   connectRuntime,
   disconnectRuntime,
-  removeRuntimeListeners,
   unwatchRuntime,
   updateConnectionPromptSetting,
   updateUSBRuntimes,
   watchRuntime,
 };
--- a/devtools/client/aboutdebugging-new/src/modules/runtime-client-factory.js
+++ b/devtools/client/aboutdebugging-new/src/modules/runtime-client-factory.js
@@ -3,49 +3,45 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { ADB } = require("devtools/shared/adb/adb");
 const { DebuggerClient } = require("devtools/shared/client/debugger-client");
 const { DebuggerServer } = require("devtools/server/main");
 const { ClientWrapper } = require("./client-wrapper");
-const { remoteClientManager } =
-  require("devtools/client/shared/remote-debugging/remote-client-manager");
 
 const { RUNTIMES } = require("../constants");
 
 async function createLocalClient() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
   const client = new DebuggerClient(DebuggerServer.connectPipe());
   await client.connect();
-  return new ClientWrapper(client);
+  return { clientWrapper: new ClientWrapper(client) };
 }
 
 async function createNetworkClient(host, port) {
-  const transport = await DebuggerClient.socketConnect({ host, port });
+  const transportDetails = { host, port };
+  const transport = await DebuggerClient.socketConnect(transportDetails);
   const client = new DebuggerClient(transport);
   await client.connect();
-  return new ClientWrapper(client);
+  return { clientWrapper: new ClientWrapper(client), transportDetails };
 }
 
 async function createUSBClient(socketPath) {
   const port = await ADB.prepareTCPConnection(socketPath);
   return createNetworkClient("localhost", port);
 }
 
 async function createClientForRuntime(runtime) {
-  const { extra, id, type } = runtime;
+  const { extra, type } = runtime;
 
   if (type === RUNTIMES.THIS_FIREFOX) {
     return createLocalClient();
-  } else if (remoteClientManager.hasClient(id, type)) {
-    const client = remoteClientManager.getClient(id, type);
-    return new ClientWrapper(client);
   } else if (type === RUNTIMES.NETWORK) {
     const { host, port } = extra.connectionParameters;
     return createNetworkClient(host, port);
   } else if (type === RUNTIMES.USB) {
     const { socketPath } = extra.connectionParameters;
     return createUSBClient(socketPath);
   }
 
--- a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
+++ b/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
@@ -14,19 +14,16 @@ const {
   USB_RUNTIMES_UPDATED,
   WATCH_RUNTIME_SUCCESS,
 } = require("../constants");
 
 const {
   findRuntimeById,
 } = require("../modules/runtimes-state-helper");
 
-const { remoteClientManager } =
-  require("devtools/client/shared/remote-debugging/remote-client-manager");
-
 // Map between known runtime types and nodes in the runtimes state.
 const TYPE_TO_RUNTIMES_KEY = {
   [RUNTIMES.THIS_FIREFOX]: "thisFirefoxRuntimes",
   [RUNTIMES.NETWORK]: "networkRuntimes",
   [RUNTIMES.USB]: "usbRuntimes",
 };
 
 function RuntimesState() {
@@ -68,24 +65,22 @@ function _updateRuntimeById(runtimeId, u
     return r;
   });
   return Object.assign({}, state, { [key]: updatedRuntimes });
 }
 
 function runtimesReducer(state = RuntimesState(), action) {
   switch (action.type) {
     case CONNECT_RUNTIME_SUCCESS: {
-      const { id, runtimeDetails, type } = action.runtime;
-      remoteClientManager.setClient(id, type, runtimeDetails.clientWrapper.client);
+      const { id, runtimeDetails } = action.runtime;
       return _updateRuntimeById(id, { runtimeDetails }, state);
     }
 
     case DISCONNECT_RUNTIME_SUCCESS: {
-      const { id, type } = action.runtime;
-      remoteClientManager.removeClient(id, type);
+      const { id } = action.runtime;
       return _updateRuntimeById(id, { runtimeDetails: null }, state);
     }
 
     case NETWORK_LOCATIONS_UPDATED: {
       const { locations } = action;
       const networkRuntimes = locations.map(location => {
         const [ host, port ] = location.split(":");
         return {
@@ -112,18 +107,18 @@ function runtimesReducer(state = Runtime
         Object.assign({}, runtime.runtimeDetails, { connectionPromptEnabled });
       return _updateRuntimeById(runtimeId, { runtimeDetails }, state);
     }
 
     case USB_RUNTIMES_UPDATED: {
       const { runtimes } = action;
       const usbRuntimes = runtimes.map(runtime => {
         const existingRuntime = findRuntimeById(runtime.id, state);
-        const existingRuntimeDetails = existingRuntime ?
-          existingRuntime.runtimeDetails : null;
+        const existingRuntimeDetails =
+          existingRuntime ? existingRuntime.runtimeDetails : null;
 
         return {
           id: runtime.id,
           extra: {
             connectionParameters: { socketPath: runtime._socketPath },
             deviceName: runtime.deviceName,
           },
           name: runtime.shortName,
--- a/devtools/client/aboutdebugging-new/src/types/runtime.js
+++ b/devtools/client/aboutdebugging-new/src/types/runtime.js
@@ -17,25 +17,37 @@ const runtimeInfo = {
 
   // name of runtime such as "Firefox Nightly"
   name: PropTypes.string.isRequired,
 
   // version of runtime
   version: PropTypes.string.isRequired,
 };
 
+const runtimeTransportDetails = {
+  // host name of tcp connection to debugger server
+  host: PropTypes.string.isRequired,
+
+  // port number of tcp connection to debugger server
+  port: PropTypes.number.isRequired,
+};
+
 const runtimeDetails = {
   // ClientWrapper built using a DebuggerClient for the runtime
   clientWrapper: PropTypes.instanceOf(ClientWrapper).isRequired,
 
   // reflect devtools.debugger.prompt-connection preference of this runtime
   connectionPromptEnabled: PropTypes.bool.isRequired,
 
   // runtime information
   info: PropTypes.shape(runtimeInfo).isRequired,
+
+  // tcp connection information,
+  // unavailable on this-firefox runtime
+  transportDetails: PropTypes.shape(runtimeTransportDetails),
 };
 
 const networkRuntimeConnectionParameter = {
   // host name of debugger server to connect
   host: PropTypes.string.isRequired,
 
   // port number of debugger server to connect
   port: PropTypes.number.isRequired,
--- a/devtools/client/aboutdebugging-new/test/browser/browser.ini
+++ b/devtools/client/aboutdebugging-new/test/browser/browser.ini
@@ -22,17 +22,16 @@ support-files =
 [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_navigate.js]
-[browser_aboutdebugging_persist_connection.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]
 skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug 1499638
 [browser_aboutdebugging_system_addons.js]
 [browser_aboutdebugging_tab_favicons.js]
deleted file mode 100644
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_persist_connection.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const RUNTIME_ID = "test-runtime-id";
-const RUNTIME_DEVICE_NAME = "test device name";
-const RUNTIME_APP_NAME = "TestApp";
-
-/* import-globals-from mocks/head-usb-mocks.js */
-Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "mocks/head-usb-mocks.js", this);
-
-// Test that remote runtime connections are persisted across about:debugging reloads.
-add_task(async function() {
-  const usbMocks = new UsbMocks();
-  usbMocks.enableMocks();
-  registerCleanupFunction(() => usbMocks.disableMocks());
-
-  let { document, tab } = await openAboutDebugging();
-
-  const usbClient = usbMocks.createRuntime(RUNTIME_ID, {
-    name: RUNTIME_APP_NAME,
-    deviceName: RUNTIME_DEVICE_NAME,
-  });
-  usbMocks.emitUpdate();
-
-  await connectToRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document);
-
-  info("Reload about:debugging");
-  document = await reloadAboutDebugging(tab);
-  usbMocks.emitUpdate();
-
-  info("Wait until the remote runtime appears as connected");
-  await waitUntil(() => {
-    const sidebarItem = findSidebarItemByText(RUNTIME_DEVICE_NAME, document);
-    return sidebarItem && !sidebarItem.querySelector(".js-connect-button");
-  });
-
-  // Remove the runtime without emitting an update.
-  // This is what happens today when we simply close Firefox for Android.
-  info("Remove the runtime from the list of USB runtimes");
-  usbMocks.removeRuntime(RUNTIME_ID);
-
-  info("Emit 'closed' on the client and wait for the sidebar item to disappear");
-  usbClient._eventEmitter.emit("closed");
-  await waitUntil(() => !findSidebarItemByText(RUNTIME_DEVICE_NAME, document));
-
-  info("Remove the tab");
-  await removeTab(tab);
-});
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
@@ -54,17 +54,17 @@ add_task(async function testShowSystemAd
 // Create a basic mock for this-firefox client, and setup a runtime-client-factory mock
 // to return our mock client when needed.
 function setupThisFirefoxMock() {
   const runtimeClientFactoryMock = createRuntimeClientFactoryMock();
   const thisFirefoxClient = createThisFirefoxClientMock();
   runtimeClientFactoryMock.createClientForRuntime = runtime => {
     const { RUNTIMES } = require("devtools/client/aboutdebugging-new/src/constants");
     if (runtime.id === RUNTIMES.THIS_FIREFOX) {
-      return thisFirefoxClient;
+      return { clientWrapper: thisFirefoxClient };
     }
     throw new Error("Unexpected runtime id " + runtime.id);
   };
 
   info("Enable mocks");
   enableRuntimeClientFactoryMock(runtimeClientFactoryMock);
   registerCleanupFunction(() => {
     disableRuntimeClientFactoryMock();
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js
@@ -18,17 +18,17 @@ Services.scriptloader.loadSubScript(
 add_task(async function() {
   // Setup a mock for our runtime client factory to return the default THIS_FIREFOX client
   // when the client for the this-firefox runtime is requested.
   const runtimeClientFactoryMock = createRuntimeClientFactoryMock();
   const thisFirefoxClient = createThisFirefoxClientMock();
   runtimeClientFactoryMock.createClientForRuntime = runtime => {
     const { RUNTIMES } = require("devtools/client/aboutdebugging-new/src/constants");
     if (runtime.id === RUNTIMES.THIS_FIREFOX) {
-      return thisFirefoxClient;
+      return { clientWrapper: thisFirefoxClient };
     }
     throw new Error("Unexpected runtime id " + runtime.id);
   };
 
   info("Enable mocks");
   enableRuntimeClientFactoryMock(runtimeClientFactoryMock);
   registerCleanupFunction(() => {
     disableRuntimeClientFactoryMock();
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -27,65 +27,43 @@ registerCleanupFunction(async function()
   try {
     const { adbAddon } = require("devtools/shared/adb/adb-addon");
     await adbAddon.uninstall();
   } catch (e) {
     // Will throw if the addon is already uninstalled, ignore exceptions here.
   }
   const { ADB } = require("devtools/shared/adb/adb");
   await ADB.kill();
-
-  const { remoteClientManager } =
-    require("devtools/client/shared/remote-debugging/remote-client-manager");
-  await remoteClientManager.removeAllClients();
 });
 
 /**
  * Enable the new about:debugging panel.
  */
 async function enableNewAboutDebugging() {
   await pushPref("devtools.aboutdebugging.new-enabled", true);
   await pushPref("devtools.aboutdebugging.network", true);
 }
 
 async function openAboutDebugging(page, win) {
   await enableNewAboutDebugging();
 
   info("opening about:debugging");
-
   const tab = await addTab("about:debugging", { window: win });
   const browser = tab.linkedBrowser;
   const document = browser.contentDocument;
   const window = browser.contentWindow;
-  await waitForInitialDispatch(window);
-
-  return { tab, document, window };
-}
-
-async function reloadAboutDebugging(tab) {
-  info("reload about:debugging");
+  const { AboutDebugging } = window;
 
-  await refreshTab(tab);
-  const browser = tab.linkedBrowser;
-  const document = browser.contentDocument;
-  const window = browser.contentWindow;
-  await waitForInitialDispatch(window);
-
-  return document;
-}
-
-function waitForInitialDispatch(win) {
-  info("wait for the initial about debugging actions to be dispatched");
-
-  const { AboutDebugging } = win;
-  return Promise.all([
+  await Promise.all([
     waitForDispatch(AboutDebugging.store, "REQUEST_EXTENSIONS_SUCCESS"),
     waitForDispatch(AboutDebugging.store, "REQUEST_TABS_SUCCESS"),
     waitForDispatch(AboutDebugging.store, "REQUEST_WORKERS_SUCCESS"),
   ]);
+
+  return { tab, document, window };
 }
 
 /**
  * Wait for all client requests to settle, meaning here that no new request has been
  * dispatched after the provided delay.
  */
 async function waitForRequestsToSettle(store, delay = 500) {
   let hasSettled = false;
--- a/devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
+++ b/devtools/client/aboutdebugging-new/test/browser/mocks/head-client-wrapper-mock.js
@@ -30,29 +30,16 @@ function createClientMock() {
       eventEmitter.once(evt, listener);
     },
     addListener: (evt, listener) => {
       eventEmitter.on(evt, listener);
     },
     removeListener: (evt, listener) => {
       eventEmitter.off(evt, listener);
     },
-
-    client: {
-      addOneTimeListener: (evt, listener) => {
-        eventEmitter.once(evt, listener);
-      },
-      addListener: (evt, listener) => {
-        eventEmitter.on(evt, listener);
-      },
-      removeListener: (evt, listener) => {
-        eventEmitter.off(evt, listener);
-      },
-    },
-
     // no-op
     close: () => {},
     // no-op
     connect: () => {},
     // no-op
     getDeviceDescription: () => {},
     // Return default preference value or null if no match.
     getPreference: (prefName) => {
--- a/devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-mocks.js
+++ b/devtools/client/aboutdebugging-new/test/browser/mocks/head-usb-mocks.js
@@ -23,30 +23,24 @@ class UsbMocks {
   constructor() {
     // Setup the usb-runtimes mock to rely on the internal _runtimes array.
     this.usbRuntimesMock = createUsbRuntimesMock();
     this._runtimes = [];
     this.usbRuntimesMock.getUSBRuntimes = () => {
       return this._runtimes;
     };
 
-    // refreshUSBRuntimes normally starts scan, which should ultimately fire the
-    // "runtime-list-updated" event.
-    this.usbRuntimesMock.refreshUSBRuntimes = () => {
-      this.emitUpdate();
-    };
-
     // Prepare a fake observer to be able to emit events from this mock.
     this._observerMock = addObserverMock(this.usbRuntimesMock);
 
     // Setup the runtime-client-factory mock to rely on the internal _clients map.
     this.runtimeClientFactoryMock = createRuntimeClientFactoryMock();
     this._clients = {};
     this.runtimeClientFactoryMock.createClientForRuntime = runtime => {
-      return this._clients[runtime.id];
+      return { clientWrapper: this._clients[runtime.id] };
     };
 
     // Add a client for THIS_FIREFOX, since about:debugging will start on the This Firefox
     // page.
     this._thisFirefoxClient = createThisFirefoxClientMock();
     this._clients[RUNTIMES.THIS_FIREFOX] = this._thisFirefoxClient;
   }
 
--- a/devtools/client/framework/target-from-url.js
+++ b/devtools/client/framework/target-from-url.js
@@ -2,18 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { TargetFactory } = require("devtools/client/framework/target");
 const { DebuggerServer } = require("devtools/server/main");
 const { DebuggerClient } = require("devtools/shared/client/debugger-client");
-const { remoteClientManager } =
-  require("devtools/client/shared/remote-debugging/remote-client-manager");
 
 /**
  * Construct a Target for a given URL object having various query parameters:
  *
  * - host, port & ws: See the documentation for clientFromURL
  *
  * - type: tab, process, window
  *      {String} The type of target to connect to.
@@ -36,24 +34,19 @@ const { remoteClientManager } =
  *
  * @param {URL} url
  *        The url to fetch query params from.
  *
  * @return A target object
  */
 exports.targetFromURL = async function targetFromURL(url) {
   const client = await clientFromURL(url);
-  const params = url.searchParams;
+  await client.connect();
 
-  // Clients retrieved from the remote-client-manager are already connected.
-  if (!params.get("remoteId")) {
-    // Connect any other client.
-    await client.connect();
-  }
-
+  const params = url.searchParams;
   const type = params.get("type");
   if (!type) {
     throw new Error("targetFromURL, missing type parameter");
   }
   let id = params.get("id");
   // Allows to spawn a chrome enabled target for any context
   // (handy to debug chrome stuff in a content process)
   let chrome = params.has("chrome");
@@ -118,34 +111,25 @@ exports.targetFromURL = async function t
 
 /**
  * Create a DebuggerClient for a given URL object having various query parameters:
  *
  * host:
  *    {String} The hostname or IP address to connect to.
  * port:
  *    {Number} The TCP port to connect to, to use with `host` argument.
- * remoteId:
- *    {String} Remote client id, for runtimes from the remote-client-manager
  * ws:
  *    {Boolean} If true, connect via websocket instead of regular TCP connection.
  *
  * @param {URL} url
  *        The url to fetch query params from.
  * @return a promise that resolves a DebuggerClient object
  */
 async function clientFromURL(url) {
   const params = url.searchParams;
-
-  // If a remote id was provided we should already have a connected client available.
-  const remoteId = params.get("remoteId");
-  if (remoteId) {
-    return remoteClientManager.getClientByRemoteId(remoteId);
-  }
-
   const host = params.get("host");
   const port = params.get("port");
   const webSocket = !!params.get("ws");
 
   let transport;
   if (port) {
     transport = await DebuggerClient.socketConnect({ host, port, webSocket });
   } else {
--- a/devtools/client/shared/moz.build
+++ b/devtools/client/shared/moz.build
@@ -8,17 +8,16 @@ BROWSER_CHROME_MANIFESTS += ['test/brows
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
 TEST_HARNESS_FILES.xpcshell.devtools.client.shared.test += [
     'test/shared-redux-head.js',
 ]
 
 DIRS += [
     'components',
     'redux',
-    'remote-debugging',
     'source-map',
     'vendor',
     'webpack',
     'widgets',
 ]
 
 DevToolsModules(
     'autocomplete-popup.js',
deleted file mode 100644
--- a/devtools/client/shared/remote-debugging/moz.build
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DevToolsModules(
-    'remote-client-manager.js',
-)
-
-with Files('**'):
-    BUG_COMPONENT = ('DevTools', 'about:debugging')
\ No newline at end of file
deleted file mode 100644
--- a/devtools/client/shared/remote-debugging/remote-client-manager.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/**
- * This class is designed to be a singleton shared by all DevTools to get access to
- * existing clients created for remote debugging.
- */
-class RemoteClientManager {
-  constructor() {
-    this._clients = new Map();
-    this._onClientClosed = this._onClientClosed.bind(this);
-  }
-
-  /**
-   * Store a remote client that is already connected.
-   *
-   * @param {String} id
-   *        Remote runtime id (see devtools/client/aboutdebugging-new/src/types).
-   * @param {String} type
-   *        Remote runtime type (see devtools/client/aboutdebugging-new/src/types).
-   * @param {DebuggerClient} client
-   */
-  setClient(id, type, client) {
-    const key = this._getKey(id, type);
-    this._clients.set(key, client);
-    client.addOneTimeListener("closed", this._onClientClosed);
-  }
-
-  // See JSDoc for id, type from setClient.
-  hasClient(id, type) {
-    return this._clients.has(this._getKey(id, type));
-  }
-
-  // See JSDoc for id, type from setClient.
-  getClient(id, type) {
-    return this._clients.get(this._getKey(id, type));
-  }
-
-  // See JSDoc for id, type from setClient.
-  removeClient(id, type) {
-    const key = this._getKey(id, type);
-    this._removeClientByKey(key);
-  }
-
-  removeAllClients() {
-    const keys = [...this._clients.keys()];
-    for (const key of keys) {
-      this._removeClientByKey(key);
-    }
-  }
-
-  getRemoteId(id, type) {
-    return encodeURIComponent(this._getKey(id, type));
-  }
-
-  getClientByRemoteId(remoteId) {
-    const key = decodeURIComponent(remoteId);
-    return this._clients.get(key);
-  }
-
-  _getKey(id, type) {
-    return id + "-" + type;
-  }
-
-  _removeClientByKey(key) {
-    if (this.hasClient(key)) {
-      this.getClient(key).removeListener("closed", this._onClientClosed);
-      this._clients.delete(key);
-    }
-  }
-
-  /**
-   * Cleanup all closed clients when a "closed" notification is received from a client.
-   */
-  _onClientClosed() {
-    const closedClientKeys = [...this._clients.keys()].filter(key => {
-      return this._clients.get(key)._closed;
-    });
-
-    for (const key of closedClientKeys) {
-      this._removeClientByKey(key);
-    }
-  }
-}
-
-// Expose a singleton of RemoteClientManager.
-exports.remoteClientManager = new RemoteClientManager();
--- a/devtools/shared/client/event-source.js
+++ b/devtools/shared/client/event-source.js
@@ -22,54 +22,50 @@ function eventSource(proto) {
    * Add a listener to the event source for a given event.
    *
    * @param name string
    *        The event to listen for.
    * @param listener function
    *        Called when the event is fired. If the same listener
    *        is added more than once, it will be called once per
    *        addListener call.
-   * @param key function (optional)
-   *        Key to use for removeListener, defaults to the listener. Used by helper method
-   *        addOneTimeListener, which creates a custom listener. Use the original listener
-   *        as key to allow to remove oneTimeListeners.
    */
-  proto.addListener = function(name, listener, key = listener) {
+  proto.addListener = function(name, listener) {
     if (typeof listener != "function") {
       throw TypeError("Listeners must be functions.");
     }
 
     if (!this._listeners) {
       this._listeners = {};
     }
 
-    this._getListeners(name).push({ key, callback: listener });
+    this._getListeners(name).push(listener);
   };
 
   /**
    * Add a listener to the event source for a given event. The
    * listener will be removed after it is called for the first time.
    *
    * @param name string
    *        The event to listen for.
    * @param listener function
    *        Called when the event is fired.
    * @returns Promise
    *          Resolved with an array of the arguments of the event.
    */
   proto.addOneTimeListener = function(name, listener) {
     return new Promise(resolve => {
-      const oneTimeListener = (eventName, ...rest) => {
-        this.removeListener(name, listener);
+      const l = (eventName, ...rest) => {
+        this.removeListener(name, l);
         if (listener) {
           listener(eventName, ...rest);
         }
         resolve(rest[0]);
       };
-      this.addListener(name, oneTimeListener, listener);
+      this.addListener(name, l);
     });
   };
 
   /**
    * Remove a listener from the event source previously added with
    * addListener().
    *
    * @param name string
@@ -82,17 +78,17 @@ function eventSource(proto) {
     if (!this._listeners || (listener && !this._listeners[name])) {
       return;
     }
 
     if (!listener) {
       this._listeners[name] = [];
     } else {
       this._listeners[name] =
-        this._listeners[name].filter(l => l.key != listener);
+        this._listeners[name].filter(l => l != listener);
     }
   };
 
   /**
    * Returns the listeners for the specified event name. If none are defined it
    * initializes an empty list and returns that.
    *
    * @param name string
@@ -120,17 +116,17 @@ function eventSource(proto) {
       return;
     }
 
     const name = arguments[0];
     const listeners = this._getListeners(name).slice(0);
 
     for (const listener of listeners) {
       try {
-        listener.callback.apply(null, arguments);
+        listener.apply(null, arguments);
       } catch (e) {
         // Prevent a bad listener from interfering with the others.
         DevToolsUtils.reportException("notify event '" + name + "'", e);
       }
     }
   };
 }
 
deleted file mode 100644
--- a/devtools/shared/tests/unit/test_eventsource.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const eventSource = require("devtools/shared/client/event-source");
-
-// Test basic event-source APIs:
-// - addListener
-// - removeListener
-// - addOneTimeListener
-
-add_task(function() {
-  // Create a basic test object that can emit events using event-source.js
-  class TestClass {}
-  eventSource(TestClass.prototype);
-  const testObject = new TestClass();
-
-  testBasicAddRemoveListener(testObject);
-
-  info("Check that one time listeners are only triggered once");
-  testOneTimeListener(testObject);
-
-  info("Check that one time listeners can be removed");
-  testRemoveOneTimeListener(testObject);
-});
-
-function testBasicAddRemoveListener(testObject) {
-  let eventsReceived = 0;
-  const onTestEvent = () => eventsReceived++;
-
-  testObject.addListener("event-testBasicAddRemoveListener", onTestEvent);
-  testObject.emit("event-testBasicAddRemoveListener");
-  ok(eventsReceived === 1, "Event listener was triggered");
-
-  testObject.emit("event-testBasicAddRemoveListener");
-  ok(eventsReceived === 2, "Event listener was triggered again");
-
-  testObject.removeListener("event-testBasicAddRemoveListener", onTestEvent);
-  testObject.emit("event-testBasicAddRemoveListener");
-  ok(eventsReceived === 2, "Event listener was not triggered anymore");
-}
-
-function testOneTimeListener(testObject) {
-  let eventsReceived = 0;
-  const onTestEvent = () => eventsReceived++;
-
-  testObject.addOneTimeListener("event-testOneTimeListener", onTestEvent);
-  testObject.emit("event-testOneTimeListener");
-  ok(eventsReceived === 1, "Event listener was triggered");
-
-  testObject.emit("event-testOneTimeListener");
-  ok(eventsReceived === 1, "Event listener was not triggered again");
-
-  testObject.removeListener("event-testOneTimeListener", onTestEvent);
-}
-
-function testRemoveOneTimeListener(testObject) {
-  let eventsReceived = 0;
-  const onTestEvent = () => eventsReceived++;
-
-  testObject.addOneTimeListener("event-testRemoveOneTimeListener", onTestEvent);
-  testObject.removeListener("event-testRemoveOneTimeListener", onTestEvent);
-  testObject.emit("event-testRemoveOneTimeListener");
-  ok(eventsReceived === 0, "Event listener was already removed");
-}
--- a/devtools/shared/tests/unit/xpcshell.ini
+++ b/devtools/shared/tests/unit/xpcshell.ini
@@ -11,17 +11,16 @@ support-files =
 [test_css-properties-db.js]
 # This test only enforces that the CSS database is up to date with nightly. The DB is
 # only used when inspecting a target that doesn't support the getCSSDatabase actor.
 # CSS properties are behind compile-time flags, and there is no automatic rebuild
 # process for uplifts, so this test breaks on uplift.
 run-if = nightly_build
 [test_eventemitter_basic.js]
 [test_eventemitter_static.js]
-[test_eventsource.js]
 [test_fetch-bom.js]
 [test_fetch-chrome.js]
 [test_fetch-file.js]
 [test_fetch-http.js]
 [test_fetch-resource.js]
 [test_flatten.js]
 [test_indentation.js]
 [test_independent_loaders.js]