Backed out changeset e7624782898d (bug 1487428) for test_inspector-insert.html failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Thu, 27 Sep 2018 23:38:04 +0300
changeset 486953 c64fc93a1be87e2131e7fa7f946f55a99cb63de7
parent 486952 859c1109cc587311a1a34f8c9339118e0403a3de
child 486954 b3657ab8de7bef220b9e5714fb52d0673eac3ac1
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
bugs1487428
milestone64.0a1
backs oute7624782898dd312db8fde3c9ebf20bde3f2431e
Backed out changeset e7624782898d (bug 1487428) for test_inspector-insert.html failures CLOSED TREE
devtools/client/sourceeditor/test/browser_css_autocompletion.js
devtools/client/sourceeditor/test/browser_editor_autocomplete_events.js
devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js
devtools/server/tests/browser/browser_accessibility_node.js
devtools/server/tests/browser/browser_accessibility_node_events.js
devtools/server/tests/browser/browser_accessibility_simple.js
devtools/server/tests/browser/browser_accessibility_walker.js
devtools/server/tests/browser/browser_animation_emitMutations.js
devtools/server/tests/browser/browser_animation_getMultipleStates.js
devtools/server/tests/browser/browser_animation_getPlayers.js
devtools/server/tests/browser/browser_animation_getProperties.js
devtools/server/tests/browser/browser_animation_getStateAfterFinished.js
devtools/server/tests/browser/browser_animation_getSubTreeAnimations.js
devtools/server/tests/browser/browser_animation_keepFinished.js
devtools/server/tests/browser/browser_animation_playPauseIframe.js
devtools/server/tests/browser/browser_animation_playPauseSeveral.js
devtools/server/tests/browser/browser_animation_playerState.js
devtools/server/tests/browser/browser_animation_reconstructState.js
devtools/server/tests/browser/browser_animation_refreshTransitions.js
devtools/server/tests/browser/browser_animation_setCurrentTime.js
devtools/server/tests/browser/browser_animation_setPlaybackRate.js
devtools/server/tests/browser/browser_animation_simple.js
devtools/server/tests/browser/browser_animation_updatedState.js
devtools/server/tests/browser/browser_layout_getGrids.js
devtools/server/tests/browser/browser_layout_simple.js
devtools/server/tests/browser/head.js
devtools/server/tests/mochitest/test_inspector-insert.html
--- a/devtools/client/sourceeditor/test/browser_css_autocompletion.js
+++ b/devtools/client/sourceeditor/test/browser_css_autocompletion.js
@@ -1,15 +1,16 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const CSSCompleter = require("devtools/client/sourceeditor/css-autocompleter");
+const {InspectorFront} = require("devtools/shared/fronts/inspector");
 
 const CSS_URI = "http://mochi.test:8888/browser/devtools/client/sourceeditor" +
                 "/test/css_statemachine_testcases.css";
 const TESTS_URI = "http://mochi.test:8888/browser/devtools/client" +
                   "/sourceeditor/test/css_autocompletion_tests.json";
 
 const source = read(CSS_URI);
 const {tests} = JSON.parse(read(TESTS_URI));
@@ -80,17 +81,17 @@ add_task(async function test() {
   await runTests();
   browser = null;
   gBrowser.removeCurrentTab();
 });
 
 async function runTests() {
   const target = await TargetFactory.forTab(gBrowser.selectedTab);
   await target.attach();
-  inspector = target.getFront("inspector");
+  inspector = InspectorFront(target.client, target.form);
   const walker = await inspector.getWalker();
   completer = new CSSCompleter({walker: walker,
                                 cssProperties: getClientCssProperties()});
   await checkStateAndMoveOn();
   await completer.walker.release();
   inspector.destroy();
   inspector = null;
   completer = null;
--- a/devtools/client/sourceeditor/test/browser_editor_autocomplete_events.js
+++ b/devtools/client/sourceeditor/test/browser_editor_autocomplete_events.js
@@ -1,26 +1,27 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+const {InspectorFront} = require("devtools/shared/fronts/inspector");
 const TEST_URI = "data:text/html;charset=UTF-8,<html><body><bar></bar>" +
                  "<div id='baz'></div><body></html>";
 
 add_task(async function() {
   await addTab(TEST_URI);
   await runTests();
 });
 
 async function runTests() {
   const target = await TargetFactory.forTab(gBrowser.selectedTab);
   await target.attach();
-  const inspector = target.getFront("inspector");
+  const inspector = InspectorFront(target.client, target.form);
   const walker = await inspector.getWalker();
   const {ed, win, edWin} = await setup(null, {
     autocomplete: true,
     mode: Editor.modes.css,
     autocompleteOpts: {walker: walker, cssProperties: getClientCssProperties()}
   });
   await testMouse(ed, edWin);
   await testKeyboard(ed, edWin);
--- a/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js
+++ b/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js
@@ -5,32 +5,32 @@
 "use strict";
 
 // Test the accessible highlighter's infobar content.
 
 const { truncateString } = require("devtools/shared/inspector/utils");
 const { MAX_STRING_LENGTH } = require("devtools/server/actors/highlighters/utils/accessibility");
 
 add_task(async function() {
-  const { target, walker, accessibility } =
+  const { client, walker, accessibility } =
     await initAccessibilityFrontForUrl(MAIN_DOMAIN + "doc_accessibility_infobar.html");
 
   const a11yWalker = await accessibility.getWalker();
   await accessibility.enable();
 
   info("Button front checks");
   await checkNameAndRole(walker, "#button", a11yWalker, "Accessible Button");
 
   info("Front with long name checks");
   await checkNameAndRole(walker, "#h1", a11yWalker,
     "Lorem ipsum dolor sit ame" + "\u2026" + "e et dolore magna aliqua.");
 
   await accessibility.disable();
   await waitForA11yShutdown();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 /**
  * A helper function for testing the accessible's displayed name and roles.
  *
  * @param  {Object} walker
  *         The DOM walker.
--- a/devtools/server/tests/browser/browser_accessibility_node.js
+++ b/devtools/server/tests/browser/browser_accessibility_node.js
@@ -2,17 +2,17 @@
  * 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";
 
 // Checks for the AccessibleActor
 
 add_task(async function() {
-  const {target, walker, accessibility} =
+  const {client, walker, accessibility} =
     await initAccessibilityFrontForUrl(MAIN_DOMAIN + "doc_accessibility.html");
   const modifiers = Services.appinfo.OS === "Darwin" ? "\u2303\u2325" : "Alt+Shift+";
 
   const a11yWalker = await accessibility.getWalker();
   await accessibility.enable();
   const buttonNode = await walker.querySelector(walker.rootNode, "#button");
   const accessibleFront = await a11yWalker.getAccessibleFor(buttonNode);
 
@@ -45,11 +45,11 @@ add_task(async function() {
   is(children.length, 1, "Accessible Front has correct number of children");
   checkA11yFront(children[0], {
     name: "Accessible Button",
     role: "text leaf"
   });
 
   await accessibility.disable();
   await waitForA11yShutdown();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_accessibility_node_events.js
+++ b/devtools/server/tests/browser/browser_accessibility_node_events.js
@@ -2,17 +2,17 @@
  * 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";
 
 // Checks for the AccessibleActor events
 
 add_task(async function() {
-  const {target, walker, accessibility} =
+  const {client, walker, accessibility} =
     await initAccessibilityFrontForUrl(MAIN_DOMAIN + "doc_accessibility.html");
   const modifiers = Services.appinfo.OS === "Darwin" ? "\u2303\u2325" : "Alt+Shift+";
 
   const a11yWalker = await accessibility.getWalker();
   await accessibility.enable();
   const rootNode = await walker.getRootNode();
   const a11yDoc = await a11yWalker.getAccessibleFor(rootNode);
   const buttonNode = await walker.querySelector(walker.rootNode, "#button");
@@ -118,11 +118,11 @@ add_task(async function() {
 
   await emitA11yEvent(firstChild, "index-in-parent-change", indexInParent =>
     is(indexInParent, 0, "Slider's first child has an updated index in parent"), () =>
     ContentTask.spawn(browser, null, () =>
       content.document.getElementById("slider").firstChild.remove()));
 
   await accessibility.disable();
   await waitForA11yShutdown();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_accessibility_simple.js
+++ b/devtools/server/tests/browser/browser_accessibility_simple.js
@@ -11,17 +11,17 @@ function checkAccessibilityState(accessi
   is(enabled, expected.enabled, "Enabled state is correct.");
   is(canBeDisabled, expected.canBeDisabled, "canBeDisabled state is correct.");
   is(canBeEnabled, expected.canBeEnabled, "canBeEnabled state is correct.");
 }
 
 // Simple checks for the AccessibilityActor and AccessibleWalkerActor
 
 add_task(async function() {
-  const { walker: domWalker, target, accessibility} = await initAccessibilityFrontForUrl(
+  const { walker: domWalker, client, accessibility} = await initAccessibilityFrontForUrl(
     "data:text/html;charset=utf-8,<title>test</title><div></div>");
 
   ok(accessibility, "The AccessibilityFront was created");
   ok(accessibility.getWalker, "The getWalker method exists");
 
   let a11yWalker = await accessibility.getWalker();
   ok(a11yWalker, "The AccessibleWalkerFront was returned");
 
@@ -58,11 +58,11 @@ add_task(async function() {
   info("Shutdown accessibility service");
   const shutdownEvent = accessibility.once("shutdown");
   await accessibility.disable();
   await waitForA11yShutdown();
   await shutdownEvent;
   checkAccessibilityState(accessibility,
     { enabled: false, canBeDisabled: true, canBeEnabled: true });
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_accessibility_walker.js
+++ b/devtools/server/tests/browser/browser_accessibility_walker.js
@@ -2,17 +2,17 @@
  * 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";
 
 // Checks for the AccessibleWalkerActor
 
 add_task(async function() {
-  const {target, walker, accessibility} =
+  const {client, walker, accessibility} =
     await initAccessibilityFrontForUrl(MAIN_DOMAIN + "doc_accessibility.html");
 
   const a11yWalker = await accessibility.getWalker();
   ok(a11yWalker, "The AccessibleWalkerFront was returned");
 
   await accessibility.enable();
   const rootNode = await walker.getRootNode();
   const a11yDoc = await a11yWalker.getAccessibleFor(rootNode);
@@ -122,11 +122,11 @@ add_task(async function() {
   const reloaded = BrowserTestUtils.browserLoaded(browser);
   const documentReady = a11yWalker.once("document-ready");
   browser.reload();
   await reloaded;
   await documentReady;
 
   await accessibility.disable();
   await waitForA11yShutdown();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_emitMutations.js
+++ b/devtools/server/tests/browser/browser_animation_emitMutations.js
@@ -3,17 +3,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test that the AnimationsActor emits events about changed animations on a
 // node after getAnimationPlayersForNode was called on that node.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Retrieve a non-animated node");
   const node = await walker.querySelector(walker.rootNode, ".not-animated");
 
   info("Retrieve the animation player for the node");
   const players = await animations.getAnimationPlayersForNode(node);
   is(players.length, 0, "The node has no animation players");
@@ -52,11 +52,11 @@ add_task(async function() {
   ok(true, "The mutations event was emitted");
   is(changes.length, 2, "There are 2 changes in the mutation event");
   ok(changes.every(({type}) => type === "removed"), "Both are removals");
   ok(changes[0].player === p1 || changes[0].player === p2,
     "The first removed player was one of the previously added players");
   ok(changes[1].player === p1 || changes[1].player === p2,
     "The second removed player was one of the previously added players");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_getMultipleStates.js
+++ b/devtools/server/tests/browser/browser_animation_getMultipleStates.js
@@ -3,22 +3,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check that the duration, iterationCount and delay are retrieved correctly for
 // multiple animations.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await playerHasAnInitialState(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function playerHasAnInitialState(walker, animations) {
   let state = await getAnimationStateForNode(walker, animations,
     ".delayed-multiple-animations", 0);
 
   is(state.duration, 500,
--- a/devtools/server/tests/browser/browser_animation_getPlayers.js
+++ b/devtools/server/tests/browser/browser_animation_getPlayers.js
@@ -2,22 +2,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check the output of getAnimationPlayersForNode
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await theRightNumberOfPlayersIsReturned(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function theRightNumberOfPlayersIsReturned(walker, animations) {
   let node = await walker.querySelector(walker.rootNode, ".not-animated");
   let players = await animations.getAnimationPlayersForNode(node);
   is(players.length, 0,
      "0 players were returned for the unanimated node");
--- a/devtools/server/tests/browser/browser_animation_getProperties.js
+++ b/devtools/server/tests/browser/browser_animation_getProperties.js
@@ -5,17 +5,17 @@
 "use strict";
 
 // Check that the AnimationPlayerActor exposes a getProperties method that
 // returns the list of animated properties in the animation.
 
 const URL = MAIN_DOMAIN + "animation.html";
 
 add_task(async function() {
-  const {target, walker, animations} = await initAnimationsFrontForUrl(URL);
+  const {client, walker, animations} = await initAnimationsFrontForUrl(URL);
 
   info("Get the test node and its animation front");
   const node = await walker.querySelector(walker.rootNode, ".simple-animation");
   const [player] = await animations.getAnimationPlayersForNode(node);
 
   ok(player.getProperties, "The front has the getProperties method");
 
   const properties = await player.getProperties();
@@ -26,11 +26,11 @@ add_task(async function() {
 
   is(propertyObject.values.length, 2,
     "The correct number of property values was retrieved");
 
   // Note that we don't really test the content of the frame object here on
   // purpose. This object comes straight out of the web animations API
   // unmodified.
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_getStateAfterFinished.js
+++ b/devtools/server/tests/browser/browser_animation_getStateAfterFinished.js
@@ -7,17 +7,17 @@
 
 // Check that the right duration/iterationCount/delay are retrieved even when
 // the node has multiple animations and one of them already ended before getting
 // the player objects.
 // See devtools/server/actors/animation.js |getPlayerIndex| for more
 // information.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Retrieve a non animated node");
   const node = await walker.querySelector(walker.rootNode, ".not-animated");
 
   info("Apply the multiple-animations-2 class to start the animations");
   await node.modifyAttributes([
     {attributeName: "class", newValue: "multiple-animations-2"}
@@ -46,11 +46,11 @@ add_task(async function() {
 
   is(players[1].state.duration, 300000,
      "The duration of the second animation is correct");
   is(players[1].state.delay, 1000,
      "The delay of the second animation is correct");
   is(players[1].state.iterationCount, 100,
      "The iterationCount of the second animation is correct");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_getSubTreeAnimations.js
+++ b/devtools/server/tests/browser/browser_animation_getSubTreeAnimations.js
@@ -7,17 +7,17 @@
 // Check that the AnimationsActor can retrieve all animations inside a node's
 // subtree (but not going into iframes).
 
 const URL = MAIN_DOMAIN + "animation.html";
 
 add_task(async function() {
   info("Creating a test document with 2 iframes containing animated nodes");
 
-  const {target, walker, animations} = await initAnimationsFrontForUrl(
+  const {client, walker, animations} = await initAnimationsFrontForUrl(
     "data:text/html;charset=utf-8," +
     "<iframe id='iframe' src='" + URL + "'></iframe>");
 
   info("Try retrieving all animations from the root doc's <body> node");
   const rootBody = await walker.querySelector(walker.rootNode, "body");
   let players = await animations.getAnimationPlayersForNode(rootBody);
   is(players.length, 0, "The node has no animation players");
 
@@ -28,11 +28,11 @@ add_task(async function() {
   players = await animations.getAnimationPlayersForNode(frameBody);
 
   // Testing for a hard-coded number of animations here would intermittently
   // fail depending on how fast or slow the test is (indeed, the test page
   // contains short transitions, and delayed animations). So just make sure we
   // at least have the infinitely running animations.
   ok(players.length >= 4, "All subtree animations were retrieved");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_keepFinished.js
+++ b/devtools/server/tests/browser/browser_animation_keepFinished.js
@@ -6,17 +6,17 @@
 "use strict";
 
 // Test that the AnimationsActor doesn't report finished animations as removed.
 // Indeed, animations that only have the "finished" playState can be modified
 // still, so we want the AnimationsActor to preserve the corresponding
 // AnimationPlayerActor.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Retrieve a non-animated node");
   const node = await walker.querySelector(walker.rootNode, ".not-animated");
 
   info("Retrieve the animation player for the node");
   let players = await animations.getAnimationPlayersForNode(node);
   is(players.length, 0, "The node has no animation players");
@@ -39,17 +39,17 @@ add_task(async function() {
   players = await animations.getAnimationPlayersForNode(node);
   is(players.length, 0, "The added animation is surely finished");
 
   is(reportedMutations.length, 1, "Only one mutation was reported");
   is(reportedMutations[0].type, "added", "The mutation was an addition");
 
   animations.off("mutations", onMutations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 function wait(ms) {
   return new Promise(resolve => {
     setTimeout(resolve, ms);
   });
 }
--- a/devtools/server/tests/browser/browser_animation_playPauseIframe.js
+++ b/devtools/server/tests/browser/browser_animation_playPauseIframe.js
@@ -7,34 +7,34 @@
 // Check that the AnimationsActor can pause/play all animations even those
 // within iframes.
 
 const URL = MAIN_DOMAIN + "animation.html";
 
 add_task(async function() {
   info("Creating a test document with 2 iframes containing animated nodes");
 
-  const {target, walker, animations} = await initAnimationsFrontForUrl(
+  const {client, walker, animations} = await initAnimationsFrontForUrl(
     "data:text/html;charset=utf-8," +
     "<iframe id='i1' src='" + URL + "'></iframe>" +
     "<iframe id='i2' src='" + URL + "'></iframe>");
 
   info("Getting the 2 iframe container nodes and animated nodes in them");
   const nodeInFrame1 = await getNodeInFrame(walker, "#i1", ".simple-animation");
   const nodeInFrame2 = await getNodeInFrame(walker, "#i2", ".simple-animation");
 
   info("Pause all animations in the test document");
   await toggleAndCheckStates(animations, nodeInFrame1, "paused");
   await toggleAndCheckStates(animations, nodeInFrame2, "paused");
 
   info("Play all animations in the test document");
   await toggleAndCheckStates(animations, nodeInFrame1, "running");
   await toggleAndCheckStates(animations, nodeInFrame2, "running");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function toggleAndCheckStates(animations, nodeFront, playState) {
   const [player] = await animations.getAnimationPlayersForNode(nodeFront);
 
   if (playState === "paused") {
     await animations.pauseSome([player]);
--- a/devtools/server/tests/browser/browser_animation_playPauseSeveral.js
+++ b/devtools/server/tests/browser/browser_animation_playPauseSeveral.js
@@ -10,26 +10,26 @@
 // This list misses a bunch of animated nodes on purpose. Only the ones that
 // have infinite animations are listed. This is done to avoid intermittents
 // caused when finite animations are already done playing by the time the test
 // runs.
 const ALL_ANIMATED_NODES = [".simple-animation", ".multiple-animations",
                             ".delayed-animation"];
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Pause all animations in the test document");
   await toggleAndCheckStates(walker, animations, ALL_ANIMATED_NODES, "paused");
 
   info("Play all animations in the test document");
   await toggleAndCheckStates(walker, animations, ALL_ANIMATED_NODES, "running");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function toggleAndCheckStates(walker, animations, selectors, playState) {
   info("Checking the playState of all the nodes that have infinite running " +
        "animations");
 
   for (const selector of selectors) {
--- a/devtools/server/tests/browser/browser_animation_playerState.js
+++ b/devtools/server/tests/browser/browser_animation_playerState.js
@@ -2,23 +2,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check the animation player's initial state
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await playerHasAnInitialState(walker, animations);
   await playerStateIsCorrect(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function playerHasAnInitialState(walker, animations) {
   const node = await walker.querySelector(walker.rootNode, ".simple-animation");
   const [player] = await animations.getAnimationPlayersForNode(node);
 
   ok(player.initialState, "The player front has an initial state");
--- a/devtools/server/tests/browser/browser_animation_reconstructState.js
+++ b/devtools/server/tests/browser/browser_animation_reconstructState.js
@@ -3,22 +3,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check that, even though the AnimationPlayerActor only sends the bits of its
 // state that change, the front reconstructs the whole state everytime.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await playerHasCompleteStateAtAllTimes(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function playerHasCompleteStateAtAllTimes(walker, animations) {
   const node = await walker.querySelector(walker.rootNode, ".simple-animation");
   const [player] = await animations.getAnimationPlayersForNode(node);
 
   // Get the list of state key names from the initialstate.
--- a/devtools/server/tests/browser/browser_animation_refreshTransitions.js
+++ b/devtools/server/tests/browser/browser_animation_refreshTransitions.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 // When a transition finishes, no "removed" event is sent because it may still
 // be used, but when it restarts again (transitions back), then a new
 // AnimationPlayerFront should be sent, and the old one should be removed.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Retrieve the test node");
   const node = await walker.querySelector(walker.rootNode, ".all-transitions");
 
   info("Retrieve the animation players for the node");
   const players = await animations.getAnimationPlayersForNode(node);
   is(players.length, 0, "The node has no animation players yet");
@@ -44,17 +44,17 @@ add_task(async function() {
   reportedMutations = await onMutations;
 
   is(reportedMutations.length, 4, "4 new mutation events were received");
   is(reportedMutations.filter(m => m.type === "removed").length, 2,
     "2 'removed' events were sent (for the old transitions)");
   is(reportedMutations.filter(m => m.type === "added").length, 2,
     "2 'added' events were sent (for the new transitions)");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 function expectMutationEvents(animationsFront, nbOfEvents) {
   return new Promise(resolve => {
     let reportedMutations = [];
     function onMutations(mutations) {
       reportedMutations = [...reportedMutations, ...mutations];
--- a/devtools/server/tests/browser/browser_animation_setCurrentTime.js
+++ b/devtools/server/tests/browser/browser_animation_setCurrentTime.js
@@ -2,22 +2,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check that the AnimationsActor allows changing many players' currentTimes at once.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await testSetCurrentTimes(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function testSetCurrentTimes(walker, animations) {
   ok(animations.setCurrentTimes, "The AnimationsActor has the right method");
 
   info("Retrieve multiple animated node and its animation players");
 
--- a/devtools/server/tests/browser/browser_animation_setPlaybackRate.js
+++ b/devtools/server/tests/browser/browser_animation_setPlaybackRate.js
@@ -3,17 +3,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Check that a player's playbackRate can be changed, and that multiple players
 // can have their rates changed at the same time.
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   info("Retrieve an animated node");
   let node = await walker.querySelector(walker.rootNode, ".simple-animation");
 
   info("Retrieve the animation player for the node");
   const [player] = await animations.getAnimationPlayersForNode(node);
 
@@ -39,11 +39,11 @@ add_task(async function() {
   await animations.setPlaybackRates(players, .5);
 
   info("Query their states and check they are correct");
   for (const animPlayer of players) {
     const animPlayerState = await animPlayer.getCurrentState();
     is(animPlayerState.playbackRate, .5, "The playbackRate was updated");
   }
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_simple.js
+++ b/devtools/server/tests/browser/browser_animation_simple.js
@@ -2,17 +2,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Simple checks for the AnimationsActor
 
 add_task(async function() {
-  const {target, walker, animations} = await initAnimationsFrontForUrl(
+  const {client, walker, animations} = await initAnimationsFrontForUrl(
     "data:text/html;charset=utf-8,<title>test</title><div></div>");
 
   ok(animations, "The AnimationsFront was created");
   ok(animations.getAnimationPlayersForNode,
      "The getAnimationPlayersForNode method exists");
   ok(animations.pauseSome, "The pauseSome method exists");
   ok(animations.playSome, "The playSome method exists");
   ok(animations.setCurrentTimes, "The setCurrentTimes method exists");
@@ -27,11 +27,11 @@ add_task(async function() {
   }
   ok(didThrow, "An exception was thrown for a missing NodeActor");
 
   const invalidNode = await walker.querySelector(walker.rootNode, "title");
   const players = await animations.getAnimationPlayersForNode(invalidNode);
   ok(Array.isArray(players), "An array of players was returned");
   is(players.length, 0, "0 players have been returned for the invalid node");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_animation_updatedState.js
+++ b/devtools/server/tests/browser/browser_animation_updatedState.js
@@ -3,22 +3,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable mozilla/no-arbitrary-setTimeout */
 
 "use strict";
 
 // Check the animation player's updated state
 
 add_task(async function() {
-  const {target, walker, animations} =
+  const {client, walker, animations} =
     await initAnimationsFrontForUrl(MAIN_DOMAIN + "animation.html");
 
   await playStateIsUpdatedDynamically(walker, animations);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 async function playStateIsUpdatedDynamically(walker, animations) {
   info("Getting the test node (which runs a very long animation)");
   // The animation lasts for 100s, to avoid intermittents.
   const node = await walker.querySelector(walker.rootNode, ".long-animation");
 
--- a/devtools/server/tests/browser/browser_layout_getGrids.js
+++ b/devtools/server/tests/browser/browser_layout_getGrids.js
@@ -103,17 +103,17 @@ const GRID_FRAGMENT_DATA = {
         state: "static",
         type: "explicit"
       }
     ]
   }
 };
 
 add_task(async function() {
-  const { target, walker, layout } =
+  const { client, walker, layout } =
     await initLayoutFrontForUrl(MAIN_DOMAIN + "grid.html");
   const grids = await layout.getGrids(walker.rootNode);
   const grid = grids[0];
   const { gridFragments } = grid;
 
   is(grids.length, 1, "One grid was returned.");
   is(gridFragments.length, 1, "One grid fragment was returned.");
   ok(Array.isArray(gridFragments), "An array of grid fragments was returned.");
@@ -124,11 +124,11 @@ add_task(async function() {
 
   try {
     const nodeFront = await walker.getNodeFromActor(grids[0].actorID, ["containerEl"]);
     ok(nodeFront, "Got the grid container node front.");
   } catch (e) {
     ok(false, "Did not get grid container node front.");
   }
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_layout_simple.js
+++ b/devtools/server/tests/browser/browser_layout_simple.js
@@ -2,17 +2,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Simple checks for the LayoutActor and GridActor
 
 add_task(async function() {
-  const {target, walker, layout} = await initLayoutFrontForUrl(
+  const {client, walker, layout} = await initLayoutFrontForUrl(
     "data:text/html;charset=utf-8,<title>test</title><div></div>");
 
   ok(layout, "The LayoutFront was created");
   ok(layout.getGrids, "The getGrids method exists");
 
   let didThrow = false;
   try {
     await layout.getGrids(null);
@@ -21,11 +21,11 @@ add_task(async function() {
   }
   ok(didThrow, "An exception was thrown for a missing NodeActor in getGrids");
 
   const invalidNode = await walker.querySelector(walker.rootNode, "title");
   const grids = await layout.getGrids(invalidNode);
   ok(Array.isArray(grids), "An array of grids was returned");
   is(grids.length, 0, "0 grids have been returned for the invalid node");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/head.js
+++ b/devtools/server/tests/browser/head.js
@@ -36,89 +36,90 @@ waitForExplicitFinish();
  *         directly, since this would be a CPOW in the e10s case,
  *         and Promises cannot be resolved with CPOWs (see bug 1233497).
  */
 var addTab = async function(url) {
   info(`Adding a new tab with URL: ${url}`);
   const tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, url);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
-  info(`Tab added a URL ${url} loaded`);
+  info(`Tab added and URL ${url} loaded`);
 
   return tab.linkedBrowser;
 };
 
-// does almost the same thing as addTab, but directly returns an object
-async function addTabTarget(url) {
-  info(`Adding a new tab with URL: ${url}`);
-  const tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, url);
-  await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
-  info(`Tab added a URL ${url} loaded`);
-  return getTargetForTab(tab);
-}
+async function initAnimationsFrontForUrl(url) {
+  const {AnimationsFront} = require("devtools/shared/fronts/animation");
 
-async function getTargetForTab(tab) {
-  const target = await TargetFactory.forTab(tab);
-  info("Attaching to the active tab.");
-  await target.attach();
-  return target;
-}
+  const { inspector, walker, client, form } = await initInspectorFront(url);
+  const animations = AnimationsFront(client, form);
 
-async function initAnimationsFrontForUrl(url) {
-  const { inspector, walker, target } = await initInspectorFront(url);
-  const animations = target.getFront("animations");
-
-  return {inspector, walker, animations, target};
+  return {inspector, walker, animations, client};
 }
 
 async function initLayoutFrontForUrl(url) {
-  const {inspector, walker, target} = await initInspectorFront(url);
+  const {inspector, walker, client} = await initInspectorFront(url);
   const layout = await walker.getLayoutInspector();
 
-  return {inspector, walker, layout, target};
+  return {inspector, walker, layout, client};
 }
 
 async function initAccessibilityFrontForUrl(url) {
-  const target = await addTabTarget(url);
-  const inspector = target.getFront("inspector");
+  const {AccessibilityFront} = require("devtools/shared/fronts/accessibility");
+  const {InspectorFront} = require("devtools/shared/fronts/inspector");
+
+  await addTab(url);
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const inspector = InspectorFront(client, form);
   const walker = await inspector.getWalker();
-  const accessibility = target.getFront("accessibility");
+  const accessibility = AccessibilityFront(client, form);
 
   await accessibility.bootstrap();
 
-  return {inspector, walker, accessibility, target};
+  return {inspector, walker, accessibility, client};
 }
 
 function initDebuggerServer() {
   try {
     // Sometimes debugger server does not get destroyed correctly by previous
     // tests.
     DebuggerServer.destroy();
   } catch (e) {
     info(`DebuggerServer destroy error: ${e}\n${e.stack}`);
   }
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 }
 
 async function initPerfFront() {
+  const {PerfFront} = require("devtools/shared/fronts/perf");
+
   initDebuggerServer();
   const client = new DebuggerClient(DebuggerServer.connectPipe());
   await waitUntilClientConnected(client);
-  const front = await client.mainRoot.getFront("perf");
+  const rootForm = await getRootForm(client);
+  const front = PerfFront(client, rootForm);
   return {front, client};
 }
 
 async function initInspectorFront(url) {
-  const target = await addTabTarget(url);
+  const { InspectorFront } = require("devtools/shared/fronts/inspector");
+  await addTab(url);
 
-  const inspector = target.getFront("inspector");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const inspector = InspectorFront(client, form);
+
   const walker = await inspector.getWalker();
 
-  return {inspector, walker, target};
+  return {inspector, walker, client, form};
 }
 
 /**
  * Gets the RootActor form from a DebuggerClient.
  * @param {DebuggerClient} client
  * @return {RootActor} Resolves when connected.
  */
 function getRootForm(client) {
@@ -243,17 +244,17 @@ function waitForMarkerType(front, types,
   info("Waiting for markers of type: " + types);
 
   function handler(name, data) {
     if (typeof name === "string" && name !== "markers") {
       return;
     }
 
     const markers = unpackFun(name, data);
-    info("Got markers");
+    info("Got markers: " + JSON.stringify(markers, null, 2));
 
     filteredMarkers = filteredMarkers.concat(
       markers.filter(m => types.includes(m.name)));
 
     if (types.every(t => filteredMarkers.some(m => m.name === t)) &&
         predicate(filteredMarkers)) {
       front.off(eventName, handler);
       resolve(filteredMarkers);
--- a/devtools/server/tests/mochitest/test_inspector-insert.html
+++ b/devtools/server/tests/mochitest/test_inspector-insert.html
@@ -20,22 +20,20 @@ window.onload = function() {
   runNextTest();
 };
 
 let gWalker = null;
 let gInspectee = null;
 
 addTest(function setup() {
   const url = document.getElementById("inspectorContent").href;
-  attachURL(url, async function(err, client, tab, doc) {
+  attachURL(url, function(err, client, tab, doc) {
     gInspectee = doc;
-    const {TargetFactory} = require("devtools/client/framework/target");
-    const target = await TargetFactory.forTab(tab);
-    await target.attach();
-    const inspectorFront = target.getFront("inspector");
+    const {InspectorFront} = require("devtools/shared/fronts/inspector");
+    const inspectorFront = InspectorFront(client, tab);
     promiseDone(inspectorFront.getWalker().then(walker => {
       ok(walker, "getWalker() should return an actor.");
       gWalker = walker;
     }).then(runNextTest));
   });
 });
 
 addAsyncTest(async function testRearrange() {