Merge mozilla-central to inbound. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Wed, 10 Oct 2018 09:20:44 +0300
changeset 496234 8af8ea2d88b0159cce6e59317d0a4adf7b5b5bf0
parent 496233 3924e39ce03a0004287b06dc478b90d257e1dd45 (current diff)
parent 496142 f5681e1f56e6d77989c3f63f9a017f5c94bd74af (diff)
child 496235 e36764125483b541b8647df406ef29ac2eb89876
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone64.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
Merge mozilla-central to inbound. CLOSED TREE
devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
devtools/client/debugger/new/test/mochitest/examples/doc_global-method-override.html
devtools/client/shared/test/addon1.xpi
devtools/client/shared/test/addon2.xpi
devtools/client/shared/test/browser_dbg_globalactor.js
devtools/client/shared/test/browser_dbg_listaddons.js
devtools/client/shared/test/browser_dbg_listtabs-01.js
devtools/client/shared/test/browser_dbg_listtabs-02.js
devtools/client/shared/test/browser_dbg_listtabs-03.js
devtools/client/shared/test/browser_dbg_multiple-windows.js
devtools/client/shared/test/browser_dbg_navigation.js
devtools/client/shared/test/browser_dbg_target-scoped-actor-01.js
devtools/client/shared/test/browser_dbg_target-scoped-actor-02.js
devtools/client/shared/test/doc_empty-tab-01.html
devtools/client/shared/test/doc_empty-tab-02.html
devtools/client/shared/test/doc_script-switching-01.html
devtools/client/shared/test/doc_script-switching-02.html
devtools/client/shared/test/testactors.js
--- a/devtools/client/debugger/new/test/mochitest/browser.ini
+++ b/devtools/client/debugger/new/test/mochitest/browser.ini
@@ -619,17 +619,16 @@ support-files =
   examples/doc-sourcemaps2.html
   examples/doc-sourcemaps3.html
   examples/doc-sourcemap-bogus.html
   examples/doc-sources.html
   examples/doc-strict.html
   examples/doc-pause-points.html
   examples/doc-return-values.html
   examples/doc-wasm-sourcemaps.html
-  examples/doc_global-method-override.html
   examples/asm.js
   examples/async.js
   examples/bogus-map.js
   examples/entry.js
   examples/exceptions.js
   examples/long.js
   examples/math.min.js
   examples/nested/nested-source.js
@@ -682,18 +681,16 @@ skip-if = (verify && !debug && (os == 'l
 skip-if = (os == "win" && ccov) # Bug 1424154
 [browser_dbg-debugger-buttons.js]
 [browser_dbg-editor-gutter.js]
 [browser_dbg-editor-select.js]
 [browser_dbg-editor-highlight.js]
 [browser_dbg-ember-quickstart.js]
 [browser_dbg-expressions.js]
 [browser_dbg-expressions-error.js]
-[browser_dbg_global-method-override.js]
-skip-if = e10s && debug
 [browser_dbg-iframes.js]
 [browser_dbg-inline-cache.js]
 [browser_dbg-keyboard-navigation.js]
 [browser_dbg-keyboard-shortcuts.js]
 skip-if = os == "linux" # bug 1351952
 [browser_dbg-layout-changes.js]
 [browser_dbg-outline.js]
 skip-if = verify
rename from devtools/client/shared/test/addon1.xpi
rename to devtools/client/debugger/test/mochitest/addon1.xpi
rename from devtools/client/shared/test/addon2.xpi
rename to devtools/client/debugger/test/mochitest/addon2.xpi
--- a/devtools/client/debugger/test/mochitest/browser.ini
+++ b/devtools/client/debugger/test/mochitest/browser.ini
@@ -1,16 +1,18 @@
 # Tests in this directory are split into two manifests (this and browser2.ini)
 # to facilitate better chunking; see bug 1294489.
 
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 skip-if = (os == 'linux' && debug && bits == 32)
 support-files =
+  addon1.xpi
+  addon2.xpi
   addon4.xpi
   addon5.xpi
   addon-webext-contentscript.xpi
   addon-source/browser_dbg_addon5/*
   code_binary_search.coffee
   code_binary_search.js
   code_binary_search.map
   code_breakpoints-break-on-last-line-of-script-on-reload.js
@@ -63,16 +65,17 @@ support-files =
   doc_empty-tab-02.html
   doc_event-listeners-01.html
   doc_event-listeners-02.html
   doc_event-listeners-03.html
   doc_frame-parameters.html
   doc_function-display-name.html
   doc_function-jump.html
   doc_function-search.html
+  doc_global-method-override.html
   doc_iframes.html
   doc_included-script.html
   doc_inline-debugger-statement.html
   doc_inline-script.html
   doc_large-array-buffer.html
   doc_listworkers-tab.html
   doc_map-set.html
   doc_minified.html
@@ -139,16 +142,20 @@ skip-if = e10s && debug
 [browser_dbg_breakpoints-eval.js]
 skip-if = e10s && debug
 [browser_dbg_breakpoints-new-script.js]
 skip-if = e10s && debug
 [browser_dbg_breakpoints-other-tabs.js]
 skip-if = e10s && debug
 [browser_dbg_bug-896139.js]
 skip-if = e10s && debug
+[browser_dbg_chrome-create.js]
+skip-if = (e10s && debug) || (verify && os == "linux") # Exit code mismatch with verify
+[browser_dbg_chrome-debugging.js]
+skip-if = e10s && debug
 [browser_dbg_clean-exit.js]
 skip-if = true # Bug 1044985 (racy test)
 [browser_dbg_closure-inspection.js]
 skip-if = e10s && debug
 [browser_dbg_conditional-breakpoints-01.js]
 skip-if = e10s && debug
 [browser_dbg_conditional-breakpoints-02.js]
 skip-if = e10s && debug
@@ -181,17 +188,32 @@ skip-if = e10s && debug
 [browser_dbg_event-listeners-01.js]
 skip-if = e10s && debug
 [browser_dbg_event-listeners-02.js]
 skip-if = e10s && debug
 [browser_dbg_event-listeners-03.js]
 skip-if = e10s && debug
 [browser_dbg_file-reload.js]
 skip-if = e10s && debug
+[browser_dbg_global-method-override.js]
+skip-if = e10s && debug
+[browser_dbg_globalactor.js]
+skip-if = e10s
 [browser_dbg_host-layout.js]
 skip-if = e10s && debug
 [browser_dbg_jump-to-function-definition.js]
 skip-if = e10s && debug
 [browser_dbg_iframes.js]
 skip-if = e10s # TODO
 [browser_dbg_interrupts.js]
 skip-if = e10s && debug
+[browser_dbg_listaddons.js]
+skip-if = e10s && debug
+tags = addons
+[browser_dbg_listtabs-01.js]
+[browser_dbg_listtabs-02.js]
+skip-if = true # Never worked for remote frames, needs a mock DebuggerServerConnection
+[browser_dbg_listtabs-03.js]
+skip-if = e10s && debug
 [browser_dbg_listworkers.js]
+[browser_dbg_multiple-windows.js]
+[browser_dbg_navigation.js]
+skip-if = e10s && debug
--- a/devtools/client/debugger/test/mochitest/browser2.ini
+++ b/devtools/client/debugger/test/mochitest/browser2.ini
@@ -1,16 +1,18 @@
 # Tests in this directory are split into two manifests (this and browser.ini)
 # to facilitate better chunking; see bug 1294489.
 
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 skip-if = (os == 'linux' && debug && bits == 32)
 support-files =
+  addon1.xpi
+  addon2.xpi
   addon4.xpi
   addon5.xpi
   addon-webext-contentscript.xpi
   addon-source/browser_dbg_addon5/*
   code_binary_search.coffee
   code_binary_search.js
   code_binary_search.map
   code_breakpoints-break-on-last-line-of-script-on-reload.js
@@ -63,16 +65,17 @@ support-files =
   doc_empty-tab-02.html
   doc_event-listeners-01.html
   doc_event-listeners-02.html
   doc_event-listeners-03.html
   doc_frame-parameters.html
   doc_function-display-name.html
   doc_function-jump.html
   doc_function-search.html
+  doc_global-method-override.html
   doc_iframes.html
   doc_included-script.html
   doc_inline-debugger-statement.html
   doc_inline-script.html
   doc_large-array-buffer.html
   doc_listworkers-tab.html
   doc_map-set.html
   doc_minified.html
@@ -151,16 +154,18 @@ uses-unsafe-cpows = true
 [browser_dbg_sources-iframe-reload.js]
 uses-unsafe-cpows = true
 skip-if = (os == "linux" && debug && bits == 64) #Bug 1455225, disable on Linux x64 debug for frequent failures
 [browser_dbg_sources-bookmarklet.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug
 [browser_dbg_split-console-paused-reload.js]
 skip-if = true # Bug 1288348 - previously e10s && debug
+[browser_dbg_target-scoped-actor-01.js]
+[browser_dbg_target-scoped-actor-02.js]
 [browser_dbg_terminate-on-tab-close.js]
 uses-unsafe-cpows = true
 skip-if = e10s && debug
 [browser_dbg_worker-console-01.js]
 skip-if = true # bug 1368569
 [browser_dbg_worker-console-02.js]
 skip-if = e10s && debug
 [browser_dbg_worker-console-03.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_chrome-create.js
@@ -0,0 +1,70 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests that a chrome debugger can be created in a new process.
+ */
+
+// There are shutdown issues for which multiple rejections are left uncaught.
+// See bug 1018184 for resolving these issues.
+const { PromiseTestUtils } = scopedCuImport("resource://testing-common/PromiseTestUtils.jsm");
+PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
+PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_FAILURE/);
+
+var gProcess;
+
+function test() {
+  // Windows XP and 8.1 test slaves are terribly slow at this test.
+  requestLongerTimeout(5);
+  Services.prefs.setBoolPref("devtools.chrome.enabled", true);
+  Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
+
+  initChromeDebugger(aOnClose).then(aProcess => {
+    gProcess = aProcess;
+
+    info("Starting test...");
+    performTest();
+  });
+}
+
+function performTest() {
+  ok(gProcess._dbgProcess,
+    "The remote debugger process wasn't created properly!");
+  ok(gProcess._dbgProcess.exitCode == null,
+    "The remote debugger process isn't running!");
+  is(typeof gProcess._dbgProcess.pid, "number",
+    "The remote debugger process doesn't have a pid (?!)");
+
+  info("process location: " + gProcess._dbgProcess.location);
+  info("process pid: " + gProcess._dbgProcess.pid);
+  info("process name: " + gProcess._dbgProcess.processName);
+  info("process sig: " + gProcess._dbgProcess.processSignature);
+
+  ok(gProcess._dbgProfilePath,
+    "The remote debugger profile wasn't created properly!");
+  is(gProcess._dbgProfilePath, OS.Path.join(OS.Constants.Path.profileDir, "chrome_debugger_profile"),
+     "The remote debugger profile isn't where we expect it!");
+
+  info("profile path: " + gProcess._dbgProfilePath);
+
+  gProcess.close();
+}
+
+function aOnClose() {
+  is(gProcess._dbgProcess.exitCode, (Services.appinfo.OS == "WINNT" ? -9 : -15),
+    "The remote debugger process didn't die cleanly.");
+
+  info("process exit value: " + gProcess._dbgProcess.exitValue);
+
+  info("profile path: " + gProcess._dbgProfilePath);
+
+  finish();
+}
+
+registerCleanupFunction(function () {
+  Services.prefs.clearUserPref("devtools.chrome.enabled");
+  Services.prefs.clearUserPref("devtools.debugger.remote-enabled");
+  gProcess = null;
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_chrome-debugging.js
@@ -0,0 +1,89 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests that chrome debugging works.
+ */
+
+const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
+
+var gClient, gThreadClient;
+var gAttached = promise.defer();
+var gNewChromeSource = promise.defer();
+
+var { DevToolsLoader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
+var customLoader = new DevToolsLoader();
+customLoader.invisibleToDebugger = true;
+var { DebuggerServer } = customLoader.require("devtools/server/main");
+
+function test() {
+  DebuggerServer.init();
+  DebuggerServer.registerAllActors();
+  DebuggerServer.allowChromeProcess = true;
+
+  let transport = DebuggerServer.connectPipe();
+  gClient = new DebuggerClient(transport);
+  gClient.connect().then(([aType, aTraits]) => {
+    is(aType, "browser",
+      "Root actor should identify itself as a browser.");
+
+    promise.all([gAttached.promise, gNewChromeSource.promise])
+      .then(resumeAndCloseConnection)
+      .then(finish)
+      .catch(aError => {
+        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
+      });
+
+    testParentProcessTargetActor();
+  });
+}
+
+function testParentProcessTargetActor() {
+  gClient.getProcess().then(aResponse => {
+    let actor = aResponse.form.actor;
+    gClient.attachTarget(actor).then(([response, tabClient]) => {
+      tabClient.attachThread(null).then(([aResponse, aThreadClient]) => {
+        gThreadClient = aThreadClient;
+        gThreadClient.addListener("newSource", onNewSource);
+
+        if (aResponse.error) {
+          ok(false, "Couldn't attach to the chrome debugger.");
+          gAttached.reject();
+        } else {
+          ok(true, "Attached to the chrome debugger.");
+          gAttached.resolve();
+
+          // Ensure that a new chrome global will be created.
+          gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
+        }
+      });
+    });
+  });
+}
+
+function onNewSource(aEvent, aPacket) {
+  if (aPacket.source.url.startsWith("chrome:")) {
+    ok(true, "Received a new chrome source: " + aPacket.source.url);
+
+    gThreadClient.removeListener("newSource", onNewSource);
+    gNewChromeSource.resolve();
+  }
+}
+
+function resumeAndCloseConnection() {
+  let deferred = promise.defer();
+  gThreadClient.resume(() => deferred.resolve(gClient.close()));
+  return deferred.promise;
+}
+
+registerCleanupFunction(function () {
+  gClient = null;
+  gThreadClient = null;
+  gAttached = null;
+  gNewChromeSource = null;
+
+  customLoader = null;
+  DebuggerServer = null;
+});
rename from devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
@@ -1,18 +1,26 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that scripts that override properties of the global object, like
- * toString, don't break the debugger. The test page used to cause the debugger
+ * toString don't break the debugger. The test page used to cause the debugger
  * to throw when trying to attach to the thread actor.
  */
 
-"use strict";
+const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
 
-add_task(async function() {
-  const dbg = await initDebugger("doc_global-method-override.html");
-  ok(dbg, "Should have a debugger available.");
-  is(dbg.toolbox.threadClient.state, "attached", "Debugger should be attached.");
-});
+function test() {
+  let options = {
+    source: TAB_URL,
+    line: 1
+  };
+  initDebugger(TAB_URL, options).then(([aTab, aPanel]) => {
+    let gDebugger = aPanel.panelWin;
+    ok(gDebugger, "Should have a debugger available.");
+    is(gDebugger.gThreadClient.state, "attached", "Debugger should be attached.");
+
+    closeDebuggerAndFinish(aPanel);
+  });
+}
rename from devtools/client/shared/test/browser_dbg_globalactor.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
--- a/devtools/client/shared/test/browser_dbg_globalactor.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
@@ -2,23 +2,17 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check extension-added global actor API.
  */
 
-"use strict";
-
-var { DebuggerServer } = require("devtools/server/main");
-var { ActorRegistry } = require("devtools/server/actors/utils/actor-registry");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
-const ACTORS_URL = EXAMPLE_URL + "testactors.js";
+const ACTORS_URL = CHROME_URL + "testactors.js";
 
 add_task(async function() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   ActorRegistry.registerModule(ACTORS_URL, {
     prefix: "testOne",
     constructor: "TestActor1",
@@ -44,17 +38,17 @@ add_task(async function() {
   response = await client.request({ to: globalActor, type: "ping" });
   is(response.pong, "pong", "Actor should respond to requests.");
 
   // Make sure that lazily-created actors are created only once.
   let count = 0;
   for (const connID of Object.getOwnPropertyNames(DebuggerServer._connections)) {
     const conn = DebuggerServer._connections[connID];
     const actorPrefix = conn._prefix + "testOne";
-    for (const pool of conn._extraPools) {
+    for (let pool of conn._extraPools) {
       for (const actor of pool.poolChildren()) {
         if (actor.actorID.startsWith(actorPrefix)) {
           count++;
         }
       }
     }
   }
 
rename from devtools/client/shared/test/browser_dbg_listaddons.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
--- a/devtools/client/shared/test/browser_dbg_listaddons.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
@@ -1,163 +1,110 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
-const chromeRegistry =
-  Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
-const DEBUGGER_CHROME_URL = "chrome://mochitests/content/browser/devtools/client/shared/test/";
-const DEBUGGER_CHROME_URI = Services.io.newURI(DEBUGGER_CHROME_URL);
-
 /**
  * Make sure the listAddons request works as specified.
  */
 const ADDON1_ID = "jid1-oBAwBoE5rSecNg@jetpack";
 const ADDON1_PATH = "addon1.xpi";
 const ADDON2_ID = "jid1-qjtzNGV8xw5h2A@jetpack";
 const ADDON2_PATH = "addon2.xpi";
 
-var gAddon1, gAddon1Actor, gAddon2, gClient;
+var gAddon1, gAddon1Actor, gAddon2, gAddon2Actor, gClient;
 
 function test() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
-  const transport = DebuggerServer.connectPipe();
+  let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     promise.resolve(null)
       .then(testFirstAddon)
       .then(testSecondAddon)
       .then(testRemoveFirstAddon)
       .then(testRemoveSecondAddon)
       .then(() => gClient.close())
       .then(finish)
-      .catch(error => {
-        ok(false, "Got an error: " + error.message + "\n" + error.stack);
+      .catch(aError => {
+        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
   });
 }
 
 function testFirstAddon() {
   let addonListChanged = false;
   gClient.addOneTimeListener("addonListChanged", () => {
     addonListChanged = true;
   });
 
-  return addTemporaryAddon(ADDON1_PATH).then(addon => {
-    gAddon1 = addon;
+  return addTemporaryAddon(ADDON1_PATH).then(aAddon => {
+    gAddon1 = aAddon;
 
-    return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
+    return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
       ok(!addonListChanged, "Should not yet be notified that list of addons changed.");
-      ok(grip, "Should find an addon actor for addon1.");
-      gAddon1Actor = grip.actor;
+      ok(aGrip, "Should find an addon actor for addon1.");
+      gAddon1Actor = aGrip.actor;
     });
   });
 }
 
 function testSecondAddon() {
   let addonListChanged = false;
-  gClient.addOneTimeListener("addonListChanged", function() {
+  gClient.addOneTimeListener("addonListChanged", function () {
     addonListChanged = true;
   });
 
-  return addTemporaryAddon(ADDON2_PATH).then(addon => {
-    gAddon2 = addon;
+  return addTemporaryAddon(ADDON2_PATH).then(aAddon => {
+    gAddon2 = aAddon;
 
-    return getAddonActorForId(gClient, ADDON1_ID).then(fistGrip => {
-      return getAddonActorForId(gClient, ADDON2_ID).then(secondGrip => {
+    return getAddonActorForId(gClient, ADDON1_ID).then(aFirstGrip => {
+      return getAddonActorForId(gClient, ADDON2_ID).then(aSecondGrip => {
         ok(addonListChanged, "Should be notified that list of addons changed.");
-        is(fistGrip.actor, gAddon1Actor, "First addon's actor shouldn't have changed.");
-        ok(secondGrip, "Should find a addon actor for the second addon.");
+        is(aFirstGrip.actor, gAddon1Actor, "First addon's actor shouldn't have changed.");
+        ok(aSecondGrip, "Should find a addon actor for the second addon.");
+        gAddon2Actor = aSecondGrip.actor;
       });
     });
   });
 }
 
 function testRemoveFirstAddon() {
   let addonListChanged = false;
-  gClient.addOneTimeListener("addonListChanged", function() {
+  gClient.addOneTimeListener("addonListChanged", function () {
     addonListChanged = true;
   });
 
   return removeAddon(gAddon1).then(() => {
-    return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
+    return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
       ok(addonListChanged, "Should be notified that list of addons changed.");
-      ok(!grip, "Shouldn't find a addon actor for the first addon anymore.");
+      ok(!aGrip, "Shouldn't find a addon actor for the first addon anymore.");
     });
   });
 }
 
 function testRemoveSecondAddon() {
   let addonListChanged = false;
-  gClient.addOneTimeListener("addonListChanged", function() {
+  gClient.addOneTimeListener("addonListChanged", function () {
     addonListChanged = true;
   });
 
   return removeAddon(gAddon2).then(() => {
-    return getAddonActorForId(gClient, ADDON2_ID).then(grip => {
+    return getAddonActorForId(gClient, ADDON2_ID).then(aGrip => {
       ok(addonListChanged, "Should be notified that list of addons changed.");
-      ok(!grip, "Shouldn't find a addon actor for the second addon anymore.");
+      ok(!aGrip, "Shouldn't find a addon actor for the second addon anymore.");
     });
   });
 }
 
-registerCleanupFunction(function() {
+registerCleanupFunction(function () {
   gAddon1 = null;
   gAddon1Actor = null;
   gAddon2 = null;
+  gAddon2Actor = null;
   gClient = null;
 });
-
-function getAddonURIFromPath(path) {
-  const chromeURI = Services.io.newURI(path, null, DEBUGGER_CHROME_URI);
-  return chromeRegistry.convertChromeURL(chromeURI).QueryInterface(Ci.nsIFileURL);
-}
-
-function addTemporaryAddon(path) {
-  const addonFile = getAddonURIFromPath(path).file;
-  info("Installing addon: " + addonFile.path);
-
-  return AddonManager.installTemporaryAddon(addonFile);
-}
-
-function getAddonActorForId(client, addonId) {
-  info("Get addon actor for ID: " + addonId);
-  const deferred = promise.defer();
-
-  client.listAddons(response => {
-    const addonTargetActor = response.addons.filter(grip => grip.id == addonId).pop();
-    info("got addon actor for ID: " + addonId);
-    deferred.resolve(addonTargetActor);
-  });
-
-  return deferred.promise;
-}
-
-function removeAddon(addon) {
-  info("Removing addon.");
-
-  const deferred = promise.defer();
-
-  const listener = {
-    onUninstalled: function(uninstalledAddon) {
-      if (uninstalledAddon != addon) {
-        return;
-      }
-      AddonManager.removeAddonListener(listener);
-      deferred.resolve();
-    }
-  };
-  AddonManager.addAddonListener(listener);
-  addon.uninstall();
-
-  return deferred.promise;
-}
rename from devtools/client/shared/test/browser_dbg_listtabs-01.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
--- a/devtools/client/shared/test/browser_dbg_listtabs-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
@@ -1,112 +1,96 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Make sure the listTabs request works as specified.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
 
 var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
 
 function test() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
-  const transport = DebuggerServer.connectPipe();
+  let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     promise.resolve(null)
       .then(testFirstTab)
       .then(testSecondTab)
       .then(testRemoveTab)
       .then(testAttachRemovedTab)
       .then(() => gClient.close())
       .then(finish)
-      .catch(error => {
-        ok(false, "Got an error: " + error.message + "\n" + error.stack);
+      .catch(aError => {
+        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
   });
 }
 
 function testFirstTab() {
-  return addTab(TAB1_URL).then(tab => {
-    gTab1 = tab;
+  return addTab(TAB1_URL).then(aTab => {
+    gTab1 = aTab;
 
-    return getTargetActorForUrl(gClient, TAB1_URL).then(grip => {
-      ok(grip, "Should find a target actor for the first tab.");
-      gTab1Actor = grip.actor;
+    return getTargetActorForUrl(gClient, TAB1_URL).then(aGrip => {
+      ok(aGrip, "Should find a target actor for the first tab.");
+      gTab1Actor = aGrip.actor;
     });
   });
 }
 
 function testSecondTab() {
-  return addTab(TAB2_URL).then(tab => {
-    gTab2 = tab;
+  return addTab(TAB2_URL).then(aTab => {
+    gTab2 = aTab;
 
-    return getTargetActorForUrl(gClient, TAB1_URL).then(firstGrip => {
-      return getTargetActorForUrl(gClient, TAB2_URL).then(secondGrip => {
-        is(firstGrip.actor, gTab1Actor, "First tab's actor shouldn't have changed.");
-        ok(secondGrip, "Should find a target actor for the second tab.");
-        gTab2Actor = secondGrip.actor;
+    return getTargetActorForUrl(gClient, TAB1_URL).then(aFirstGrip => {
+      return getTargetActorForUrl(gClient, TAB2_URL).then(aSecondGrip => {
+        is(aFirstGrip.actor, gTab1Actor, "First tab's actor shouldn't have changed.");
+        ok(aSecondGrip, "Should find a target actor for the second tab.");
+        gTab2Actor = aSecondGrip.actor;
       });
     });
   });
 }
 
 function testRemoveTab() {
   return removeTab(gTab1).then(() => {
-    return getTargetActorForUrl(gClient, TAB1_URL).then(grip => {
-      ok(!grip, "Shouldn't find a target actor for the first tab anymore.");
+    return getTargetActorForUrl(gClient, TAB1_URL).then(aGrip => {
+      ok(!aGrip, "Shouldn't find a target actor for the first tab anymore.");
     });
   });
 }
 
 function testAttachRemovedTab() {
   return removeTab(gTab2).then(() => {
-    const deferred = promise.defer();
+    let deferred = promise.defer();
 
-    gClient.addListener("paused", () => {
+    gClient.addListener("paused", (aEvent, aPacket) => {
       ok(false, "Attaching to an exited target actor shouldn't generate a pause.");
       deferred.reject();
     });
 
-    gClient.request({ to: gTab2Actor, type: "attach" }, response => {
-      is(response.error, "connectionClosed",
+    gClient.request({ to: gTab2Actor, type: "attach" }, aResponse => {
+      is(aResponse.error, "connectionClosed",
          "Connection is gone since the tab was removed.");
       deferred.resolve();
     });
 
     return deferred.promise;
   });
 }
 
-registerCleanupFunction(function() {
+registerCleanupFunction(function () {
   gTab1 = null;
   gTab1Actor = null;
   gTab2 = null;
   gTab2Actor = null;
   gClient = null;
 });
-
-function getTargetActorForUrl(client, url) {
-  const deferred = promise.defer();
-
-  client.listTabs().then(response => {
-    const targetActor = response.tabs.filter(grip => grip.url == url).pop();
-    deferred.resolve(targetActor);
-  });
-
-  return deferred.promise;
-}
rename from devtools/client/shared/test/browser_dbg_listtabs-02.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
--- a/devtools/client/shared/test/browser_dbg_listtabs-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
@@ -3,17 +3,16 @@
 
 "use strict";
 
 /**
  * Make sure the root actor's live tab list implementation works as specified.
  */
 
 var { BrowserTabList } = require("devtools/server/actors/webbrowser");
-var { DebuggerServer } = require("devtools/server/main");
 
 var gTestPage = "data:text/html;charset=utf-8," + encodeURIComponent(
   "<title>JS Debugger BrowserTabList test page</title><body>Yo.</body>");
 
 // The tablist object whose behavior we observe.
 var gTabList;
 var gFirstActor, gActorA;
 var gTabA, gTabB, gTabC;
@@ -50,70 +49,62 @@ function test() {
     .then(checkSingleTab)
     .then(finishUp);
 }
 
 function checkSingleTab() {
   return gTabList.getList().then(targetActors => {
     is(targetActors.length, 1, "initial tab list: contains initial tab");
     gFirstActor = targetActors[0];
-    is(
-      gFirstActor.url,
-      "about:blank",
-      "initial tab list: initial tab URL is 'about:blank'"
-    );
+    is(gFirstActor.url, "about:blank", "initial tab list: initial tab URL is 'about:blank'");
     is(gFirstActor.title, "New Tab", "initial tab list: initial tab title is 'New Tab'");
   });
 }
 
 function addTabA() {
-  return addTab(gTestPage).then(tab => {
-    gTabA = tab;
+  return addTab(gTestPage).then(aTab => {
+    gTabA = aTab;
   });
 }
 
 function testTabA() {
   is(onListChangedCount, 1, "onListChanged handler call count");
 
   return gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 2, "gTabA opened: two tabs in list");
     ok(targetActors.has(gFirstActor), "gTabA opened: initial tab present");
 
     info("actors: " + [...targetActors].map(a => a.url));
     gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
     ok(gActorA.url.match(/^data:text\/html;/), "gTabA opened: new tab URL");
-    is(
-      gActorA.title,
-      "JS Debugger BrowserTabList test page",
-      "gTabA opened: new tab title"
-    );
+    is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA opened: new tab title");
   });
 }
 
 function addTabB() {
-  return addTab(gTestPage).then(tab => {
-    gTabB = tab;
+  return addTab(gTestPage).then(aTab => {
+    gTabB = aTab;
   });
 }
 
 function testTabB() {
   is(onListChangedCount, 2, "onListChanged handler call count");
 
   return gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 3, "gTabB opened: three tabs in list");
   });
 }
 
 function removeTabA() {
-  const deferred = promise.defer();
+  let deferred = promise.defer();
 
-  once(gBrowser.tabContainer, "TabClose").then(event => {
-    ok(!event.detail.adoptedBy, "This was a normal tab close");
+  once(gBrowser.tabContainer, "TabClose").then(aEvent => {
+    ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
 
     // Let the actor's TabClose handler finish first.
     executeSoon(deferred.resolve);
   }, false);
 
   removeTab(gTabA);
   return deferred.promise;
 }
@@ -124,44 +115,40 @@ function testTabClosed() {
   gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 2, "gTabA closed: two tabs in list");
     ok(targetActors.has(gFirstActor), "gTabA closed: initial tab present");
 
     info("actors: " + [...targetActors].map(a => a.url));
     gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
     ok(gActorA.url.match(/^data:text\/html;/), "gTabA closed: new tab URL");
-    is(
-      gActorA.title,
-      "JS Debugger BrowserTabList test page",
-      "gTabA closed: new tab title"
-    );
+    is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA closed: new tab title");
   });
 }
 
 function addTabC() {
-  return addTab(gTestPage).then(tab => {
-    gTabC = tab;
+  return addTab(gTestPage).then(aTab => {
+    gTabC = aTab;
   });
 }
 
 function testTabC() {
   is(onListChangedCount, 4, "onListChanged handler call count");
 
   gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 3, "gTabC opened: three tabs in list");
   });
 }
 
 function removeTabC() {
-  const deferred = promise.defer();
+  let deferred = promise.defer();
 
-  once(gBrowser.tabContainer, "TabClose").then(event => {
-    ok(event.detail.adoptedBy, "This was a tab closed by moving");
+  once(gBrowser.tabContainer, "TabClose").then(aEvent => {
+    ok(aEvent.detail.adoptedBy, "This was a tab closed by moving");
 
     // Let the actor's TabClose handler finish first.
     executeSoon(deferred.resolve);
   }, false);
 
   gNewWindow = gBrowser.replaceTabWithWindow(gTabC);
   return deferred.promise;
 }
@@ -172,29 +159,25 @@ function testNewWindow() {
   return gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 3, "gTabC closed: three tabs in list");
     ok(targetActors.has(gFirstActor), "gTabC closed: initial tab present");
 
     info("actors: " + [...targetActors].map(a => a.url));
     gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
     ok(gActorA.url.match(/^data:text\/html;/), "gTabC closed: new tab URL");
-    is(
-      gActorA.title,
-      "JS Debugger BrowserTabList test page",
-      "gTabC closed: new tab title"
-    );
+    is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabC closed: new tab title");
   });
 }
 
 function removeNewWindow() {
-  const deferred = promise.defer();
+  let deferred = promise.defer();
 
-  once(gNewWindow, "unload").then(event => {
-    ok(!event.detail, "This was a normal window close");
+  once(gNewWindow, "unload").then(aEvent => {
+    ok(!aEvent.detail, "This was a normal window close");
 
     // Let the actor's TabClose handler finish first.
     executeSoon(deferred.resolve);
   }, false);
 
   gNewWindow.close();
   return deferred.promise;
 }
@@ -205,29 +188,25 @@ function testWindowClosed() {
   return gTabList.getList().then(targetActors => {
     targetActors = new Set(targetActors);
     is(targetActors.size, 2, "gNewWindow closed: two tabs in list");
     ok(targetActors.has(gFirstActor), "gNewWindow closed: initial tab present");
 
     info("actors: " + [...targetActors].map(a => a.url));
     gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
     ok(gActorA.url.match(/^data:text\/html;/), "gNewWindow closed: new tab URL");
-    is(
-      gActorA.title,
-      "JS Debugger BrowserTabList test page",
-      "gNewWindow closed: new tab title"
-    );
+    is(gActorA.title, "JS Debugger BrowserTabList test page", "gNewWindow closed: new tab title");
   });
 }
 
 function removeTabB() {
-  const deferred = promise.defer();
+  let deferred = promise.defer();
 
-  once(gBrowser.tabContainer, "TabClose").then(event => {
-    ok(!event.detail.adoptedBy, "This was a normal tab close");
+  once(gBrowser.tabContainer, "TabClose").then(aEvent => {
+    ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
 
     // Let the actor's TabClose handler finish first.
     executeSoon(deferred.resolve);
   }, false);
 
   removeTab(gTabB);
   return deferred.promise;
 }
rename from devtools/client/shared/test/browser_dbg_listtabs-03.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
--- a/devtools/client/shared/test/browser_dbg_listtabs-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
@@ -1,61 +1,59 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Make sure the listTabs request works as specified.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-var { Task } = require("devtools/shared/task");
-
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
-var gClient;
+var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
 
 function test() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
-  const transport = DebuggerServer.connectPipe();
+  let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(Task.async(function* ([aType, aTraits]) {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
-    const tab = yield addTab(TAB1_URL);
+    let tab = yield addTab(TAB1_URL);
 
     let { tabs } = yield gClient.listTabs();
     is(tabs.length, 2, "Should be two tabs");
-    const tabGrip = tabs.filter(a => a.url == TAB1_URL).pop();
+    let tabGrip = tabs.filter(a => a.url == TAB1_URL).pop();
     ok(tabGrip, "Should have an actor for the tab");
 
     let response = yield gClient.request({ to: tabGrip.actor, type: "attach" });
     is(response.type, "tabAttached", "Should have attached");
 
     response = yield gClient.listTabs();
     tabs = response.tabs;
 
     response = yield gClient.request({ to: tabGrip.actor, type: "detach" });
     is(response.type, "detached", "Should have detached");
 
-    const newGrip = tabs.filter(a => a.url == TAB1_URL).pop();
+    let newGrip = tabs.filter(a => a.url == TAB1_URL).pop();
     is(newGrip.actor, tabGrip.actor, "Should have the same actor for the same tab");
 
     response = yield gClient.request({ to: tabGrip.actor, type: "attach" });
     is(response.type, "tabAttached", "Should have attached");
     response = yield gClient.request({ to: tabGrip.actor, type: "detach" });
     is(response.type, "detached", "Should have detached");
 
     yield removeTab(tab);
     yield gClient.close();
     finish();
   }));
 }
 
-registerCleanupFunction(function() {
+registerCleanupFunction(function () {
+  gTab1 = null;
+  gTab1Actor = null;
+  gTab2 = null;
+  gTab2Actor = null;
   gClient = null;
 });
rename from devtools/client/shared/test/browser_dbg_multiple-windows.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
--- a/devtools/client/shared/test/browser_dbg_multiple-windows.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
@@ -1,23 +1,18 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Make sure that the debugger attaches to the right tab when multiple windows
  * are open.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
 const TAB1_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 const TAB2_URL = EXAMPLE_URL + "doc_script-switching-02.html";
 
 add_task(async function() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   const transport = DebuggerServer.connectPipe();
@@ -87,29 +82,21 @@ async function testFocusFirst(client) {
 async function testRemoveTab(client, win, tab) {
   win.close();
 
   // give it time to close
   await new Promise(resolve => executeSoon(resolve));
   await continue_remove_tab(client, tab);
 }
 
-async function continue_remove_tab(client, tab) {
+async function continue_remove_tab(client, tab)
+{
   removeTab(tab);
 
   const response = await client.listTabs();
   // Verify that tabs are no longer included in listTabs.
   const foundTab1 = response.tabs.some(grip => grip.url == TAB1_URL);
   const foundTab2 = response.tabs.some(grip => grip.url == TAB2_URL);
   ok(!foundTab1, "Tab1 should be gone.");
   ok(!foundTab2, "Tab2 should be gone.");
 
   is(response.selected, 0, "The original tab is selected.");
 }
-
-function addWindow(url) {
-  info("Adding window: " + url);
-  return promise.resolve(getChromeWindow(window.open(url)));
-}
-
-function getChromeWindow(win) {
-  return win.docShell.rootTreeItem.domWindow;
-}
rename from devtools/client/shared/test/browser_dbg_navigation.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
--- a/devtools/client/shared/test/browser_dbg_navigation.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
@@ -1,99 +1,73 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Check tab attach/navigation.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
-const TAB2_FILE = "doc_empty-tab-02.html";
-const TAB2_URL = EXAMPLE_URL + TAB2_FILE;
+const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
 
 var gClient;
 
 function test() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
-  const transport = DebuggerServer.connectPipe();
+  let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB1_URL)
       .then(() => attachTargetActorForUrl(gClient, TAB1_URL))
       .then(testNavigate)
       .then(testDetach)
       .then(finish)
-      .catch(error => {
-        ok(false, "Got an error: " + error.message + "\n" + error.stack);
+      .catch(aError => {
+        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
   });
 }
 
 function testNavigate([aGrip, aResponse]) {
-  const outstanding = [promise.defer(), promise.defer()];
+  let outstanding = [promise.defer(), promise.defer()];
 
-  gClient.addListener("tabNavigated", function onTabNavigated(event, packet) {
-    is(packet.url.split("/").pop(), TAB2_FILE,
+  gClient.addListener("tabNavigated", function onTabNavigated(aEvent, aPacket) {
+    is(aPacket.url, TAB2_URL,
       "Got a tab navigation notification.");
 
-    info(JSON.stringify(packet));
-    info(JSON.stringify(event));
-
-    if (packet.state == "start") {
+    if (aPacket.state == "start") {
       ok(true, "Tab started to navigate.");
       outstanding[0].resolve();
     } else {
       ok(true, "Tab finished navigating.");
       gClient.removeListener("tabNavigated", onTabNavigated);
       outstanding[1].resolve();
     }
   });
 
   BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TAB2_URL);
   return promise.all(outstanding.map(e => e.promise))
                 .then(() => aGrip.actor);
 }
 
-function testDetach(actor) {
-  const deferred = promise.defer();
+function testDetach(aActor) {
+  let deferred = promise.defer();
 
-  gClient.addOneTimeListener("tabDetached", (type, packet) => {
+  gClient.addOneTimeListener("tabDetached", (aType, aPacket) => {
     ok(true, "Got a tab detach notification.");
-    is(packet.from, actor, "tab detach message comes from the expected actor");
+    is(aPacket.from, aActor, "tab detach message comes from the expected actor");
     deferred.resolve(gClient.close());
   });
 
   removeTab(gBrowser.selectedTab);
   return deferred.promise;
 }
 
-registerCleanupFunction(function() {
+registerCleanupFunction(function () {
   gClient = null;
 });
-
-async function attachTargetActorForUrl(client, url) {
-  const grip = await getTargetActorForUrl(client, url);
-  const [ response ] = await client.attachTarget(grip.actor);
-  return [grip, response];
-}
-
-function getTargetActorForUrl(client, url) {
-  const deferred = promise.defer();
-
-  client.listTabs().then(response => {
-    const targetActor = response.tabs.filter(grip => grip.url == url).pop();
-    deferred.resolve(targetActor);
-  });
-
-  return deferred.promise;
-}
rename from devtools/client/shared/test/browser_dbg_target-scoped-actor-01.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-01.js
--- a/devtools/client/shared/test/browser_dbg_target-scoped-actor-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-01.js
@@ -1,23 +1,18 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Check target-scoped actor lifetimes.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
-const ACTORS_URL = EXAMPLE_URL + "testactors.js";
+const ACTORS_URL = CHROME_URL + "testactors.js";
 const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
 add_task(async function test() {
   await addTab(TAB_URL);
 
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
@@ -42,25 +37,8 @@ async function testTargetScopedActor(cli
   ok(grip.testOneActor,
     "Found the test target-scoped actor.");
   ok(grip.testOneActor.includes("testOne"),
     "testOneActor's actorPrefix should be used.");
 
   const response = await client.request({ to: grip.testOneActor, type: "ping" });
   is(response.pong, "pong", "Actor should respond to requests.");
 }
-
-async function attachTargetActorForUrl(client, url) {
-  const grip = await getTargetActorForUrl(client, url);
-  const [ response ] = await client.attachTarget(grip.actor);
-  return [grip, response];
-}
-
-function getTargetActorForUrl(client, url) {
-  const deferred = promise.defer();
-
-  client.listTabs().then(response => {
-    const targetActor = response.tabs.filter(grip => grip.url == url).pop();
-    deferred.resolve(targetActor);
-  });
-
-  return deferred.promise;
-}
rename from devtools/client/shared/test/browser_dbg_target-scoped-actor-02.js
rename to devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-02.js
--- a/devtools/client/shared/test/browser_dbg_target-scoped-actor-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-02.js
@@ -1,23 +1,18 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-"use strict";
-
 /**
  * Check target-scoped actor lifetimes.
  */
 
-var { DebuggerServer } = require("devtools/server/main");
-var { DebuggerClient } = require("devtools/shared/client/debugger-client");
-
-const ACTORS_URL = EXAMPLE_URL + "testactors.js";
+const ACTORS_URL = CHROME_URL + "testactors.js";
 const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
 add_task(async function() {
   await addTab(TAB_URL);
 
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
@@ -53,25 +48,8 @@ async function testTargetScopedActor(cli
 async function closeTab(client, grip) {
   await removeTab(gBrowser.selectedTab);
   await Assert.rejects(
     client.request({ to: grip.testOneActor, type: "ping" }),
     err => err.message === `'ping' active request packet to '${grip.testOneActor}' ` +
                            `can't be sent as the connection just closed.`,
     "testOneActor went away.");
 }
-
-async function attachTargetActorForUrl(client, url) {
-  const grip = await getTargetActorForUrl(client, url);
-  const [ response ] = await client.attachTarget(grip.actor);
-  return [grip, response];
-}
-
-function getTargetActorForUrl(client, url) {
-  const deferred = promise.defer();
-
-  client.listTabs().then(response => {
-    const targetActor = response.tabs.filter(grip => grip.url == url).pop();
-    deferred.resolve(targetActor);
-  });
-
-  return deferred.promise;
-}
rename from devtools/client/debugger/new/test/mochitest/examples/doc_global-method-override.html
rename to devtools/client/debugger/test/mochitest/doc_global-method-override.html
--- a/devtools/client/shared/test/browser.ini
+++ b/devtools/client/shared/test/browser.ini
@@ -1,37 +1,31 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 support-files =
-  addon1.xpi
-  addon2.xpi
   browser_devices.json
   doc_cubic-bezier-01.html
   doc_cubic-bezier-02.html
-  doc_empty-tab-01.html
-  doc_empty-tab-02.html
   doc_filter-editor-01.html
   doc_html_tooltip-02.xul
   doc_html_tooltip-03.xul
   doc_html_tooltip-04.xul
   doc_html_tooltip-05.xul
   doc_html_tooltip.xul
   doc_html_tooltip_arrow-01.xul
   doc_html_tooltip_arrow-02.xul
   doc_html_tooltip_doorhanger-01.xul
   doc_html_tooltip_doorhanger-02.xul
   doc_html_tooltip_hover.xul
   doc_html_tooltip_rtl.xul
   doc_inplace-editor_autocomplete_offset.xul
   doc_layoutHelpers-getBoxQuads.html
   doc_layoutHelpers.html
   doc_options-view.xul
-  doc_script-switching-01.html
-  doc_script-switching-02.html
   doc_spectrum.html
   doc_tableWidget_basic.html
   doc_tableWidget_keyboard_interaction.xul
   doc_tableWidget_mouse_interaction.xul
   doc_templater_basic.html
   dummy.html
   frame-script-utils.js
   head.js
@@ -39,31 +33,28 @@ support-files =
   helper_html_tooltip.js
   helper_inplace_editor.js
   leakhunt.js
   shared-head.js
   shared-redux-head.js
   telemetry-test-helpers.js
   test-actor-registry.js
   test-actor.js
-  testactors.js
   !/devtools/client/responsive.html/test/browser/devices.json
 
 [browser_autocomplete_popup.js]
 [browser_css_angle.js]
 [browser_css_color.js]
 [browser_cubic-bezier-01.js]
 [browser_cubic-bezier-02.js]
 [browser_cubic-bezier-03.js]
 [browser_cubic-bezier-04.js]
 [browser_cubic-bezier-05.js]
 [browser_cubic-bezier-06.js]
 [browser_cubic-bezier-07.js]
-[browser_dbg_globalactor.js]
-skip-if = e10s
 [browser_filter-editor-01.js]
 [browser_filter-editor-02.js]
 [browser_filter-editor-03.js]
 [browser_filter-editor-04.js]
 [browser_filter-editor-05.js]
 [browser_filter-editor-06.js]
 [browser_filter-editor-07.js]
 [browser_filter-editor-08.js]
@@ -208,21 +199,8 @@ skip-if = !e10s || os == "win" # RDM onl
 [browser_telemetry_toolboxtabs_webaudioeditor.js]
 [browser_telemetry_toolboxtabs_webconsole.js]
 [browser_treeWidget_basic.js]
 [browser_treeWidget_keyboard_interaction.js]
 [browser_treeWidget_mouse_interaction.js]
 [browser_devices.js]
 skip-if = verify
 [browser_theme_switching.js]
-[browser_dbg_listaddons.js]
-skip-if = e10s && debug
-tags = addons
-[browser_dbg_listtabs-01.js]
-[browser_dbg_listtabs-02.js]
-skip-if = true # Never worked for remote frames, needs a mock DebuggerServerConnection
-[browser_dbg_listtabs-03.js]
-skip-if = e10s && debug
-[browser_dbg_multiple-windows.js]
-[browser_dbg_navigation.js]
-skip-if = e10s && debug
-[browser_dbg_target-scoped-actor-01.js]
-[browser_dbg_target-scoped-actor-02.js]
\ No newline at end of file
deleted file mode 100644
--- a/devtools/client/shared/test/doc_empty-tab-01.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Empty test page 1</title>
-  </head>
-
-  <body>
-  </body>
-
-</html>
deleted file mode 100644
--- a/devtools/client/shared/test/doc_empty-tab-02.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Empty test page 2</title>
-  </head>
-
-  <body>
-  </body>
-
-</html>
deleted file mode 100644
--- a/devtools/client/shared/test/doc_script-switching-01.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Debugger test page</title>
-  </head>
-
-  <body>
-    <button onclick="firstCall()">Click me!</button>
-
-    <script type="text/javascript" src="code_script-switching-01.js"></script>
-    <script type="text/javascript" src="code_script-switching-02.js"></script>
-  </body>
-
-</html>
deleted file mode 100644
--- a/devtools/client/shared/test/doc_script-switching-02.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Debugger test page</title>
-  </head>
-
-  <body>
-    <button onclick="firstCall()">Click me!</button>
-
-    <script type="text/javascript" src="code_script-switching-01.js"></script>
-    <script type="text/javascript" src="code_script-switching-02.js?foo=bar,baz|lol"></script>
-  </body>
-
-</html>
--- a/devtools/client/shared/test/head.js
+++ b/devtools/client/shared/test/head.js
@@ -11,18 +11,16 @@
 Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js", this);
 
 const {DOMHelpers} = ChromeUtils.import("resource://devtools/client/shared/DOMHelpers.jsm", {});
 const {Hosts} = require("devtools/client/framework/toolbox-hosts");
 
 const TEST_URI_ROOT = "http://example.com/browser/devtools/client/shared/test/";
 const OPTIONS_VIEW_URL = TEST_URI_ROOT + "doc_options-view.xul";
 
-const EXAMPLE_URL = "chrome://mochitests/content/browser/devtools/client/shared/test/";
-
 function catchFail(func) {
   return function() {
     try {
       return func.apply(null, arguments);
     } catch (ex) {
       ok(false, ex);
       console.error(ex);
       finish();
deleted file mode 100644
--- a/devtools/client/shared/test/testactors.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-function TestActor1(connection, tab) {
-  this.conn = connection;
-  this.tab = tab;
-}
-
-TestActor1.prototype = {
-  actorPrefix: "testOne",
-
-  grip: function TA1_grip() {
-    return { actor: this.actorID,
-             test: "TestActor1" };
-  },
-
-  onPing: function TA1_onPing() {
-    return { pong: "pong" };
-  }
-};
-
-TestActor1.prototype.requestTypes = {
-  "ping": TestActor1.prototype.onPing
-};
-exports.TestActor1 = TestActor1;