Backed out changeset cb8b8676ee77 (bug 1494605) as per Yulia`s request.
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Thu, 04 Oct 2018 14:12:32 +0300
changeset 495293 f394dec256736d9ccd559397cdc33b101aee9445
parent 495292 fc4e7aa8f23ec6048fea85e69703deebe2b7477c
child 495294 1873f93e51a63549336cce3df1c850e743352a19
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)
bugs1494605
milestone64.0a1
backs outcb8b8676ee770d72bb3ef14defa75c827e134b1d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset cb8b8676ee77 (bug 1494605) as per Yulia`s request.
devtools/server/tests/browser/browser_markers-cycle-collection.js
devtools/server/tests/browser/browser_markers-gc.js
devtools/server/tests/browser/browser_markers-minor-gc.js
devtools/server/tests/browser/browser_markers-parse-html.js
devtools/server/tests/browser/browser_markers-styles.js
devtools/server/tests/browser/browser_markers-timestamp.js
devtools/server/tests/browser/browser_perf-allocation-data.js
devtools/server/tests/browser/browser_perf-profiler-01.js
devtools/server/tests/browser/browser_perf-profiler-02.js
devtools/server/tests/browser/browser_perf-profiler-03.js
devtools/server/tests/browser/browser_perf-realtime-markers.js
devtools/server/tests/browser/browser_perf-recording-actor-01.js
devtools/server/tests/browser/browser_perf-recording-actor-02.js
devtools/server/tests/browser/browser_perf-samples-01.js
devtools/server/tests/browser/browser_perf-samples-02.js
--- a/devtools/server/tests/browser/browser_markers-cycle-collection.js
+++ b/devtools/server/tests/browser/browser_markers-cycle-collection.js
@@ -2,29 +2,35 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get "nsCycleCollector::Collect" and
  * "nsCycleCollector::ForgetSkippable" markers when we force cycle collection.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
   // This test runs very slowly on linux32 debug EC2 instances.
   requestLongerTimeout(2);
 
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_force_cc.html");
-  const front = target.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_force_cc.html");
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   const markers = await waitForMarkerType(front,
     ["nsCycleCollector::Collect", "nsCycleCollector::ForgetSkippable"]);
   await front.stopRecording(rec);
 
   ok(markers.some(m => m.name === "nsCycleCollector::Collect"),
     "got some nsCycleCollector::Collect markers");
   ok(markers.some(m => m.name === "nsCycleCollector::ForgetSkippable"),
     "got some nsCycleCollector::Collect markers");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_markers-gc.js
+++ b/devtools/server/tests/browser/browser_markers-gc.js
@@ -1,21 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get "GarbageCollection" markers.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const MARKER_NAME = "GarbageCollection";
 
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_force_gc.html");
-  const front = target.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_force_gc.html");
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   let markers = await waitForMarkerType(front, MARKER_NAME);
   await front.stopRecording(rec);
 
   ok(markers.some(m => m.name === MARKER_NAME), `got some ${MARKER_NAME} markers`);
   ok(markers.every(({causeName}) => typeof causeName === "string"),
@@ -36,11 +41,11 @@ add_task(async function() {
         start time (${current.start}) thanprevious: ${previousStart}`);
       ordered = false;
     }
     return current.start;
   });
 
   is(ordered, true, "All GC and non-GC markers are in order by start time.");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_markers-minor-gc.js
+++ b/devtools/server/tests/browser/browser_markers-minor-gc.js
@@ -2,26 +2,32 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get "MinorGC" markers when we continue to steadily allocate
  * objects.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
   // This test runs very slowly on linux32 debug EC2 instances.
   requestLongerTimeout(2);
 
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_allocations.html");
-  const front = target.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_allocations.html");
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   const markers = await waitForMarkerType(front, ["MinorGC"]);
   await front.stopRecording(rec);
 
   ok(markers.some(m => m.name === "MinorGC" && m.causeName),
      "got some MinorGC markers");
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_markers-parse-html.js
+++ b/devtools/server/tests/browser/browser_markers-parse-html.js
@@ -1,25 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get "Parse HTML" markers.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const MARKER_NAME = "Parse HTML";
 
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_innerHTML.html");
+  await addTab(MAIN_DOMAIN + "doc_innerHTML.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   const markers = await waitForMarkerType(front, MARKER_NAME);
   await front.stopRecording(rec);
 
   ok(markers.some(m => m.name === MARKER_NAME), `got some ${MARKER_NAME} markers`);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_markers-styles.js
+++ b/devtools/server/tests/browser/browser_markers-styles.js
@@ -1,26 +1,30 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get "Styles" markers with correct meta.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const MARKER_NAME = "Styles";
 
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   const markers = await waitForMarkerType(front, MARKER_NAME);
 
   await front.stopRecording(rec);
 
   ok(markers.some(m => m.name === MARKER_NAME), `got some ${MARKER_NAME} markers`);
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_markers-timestamp.js
+++ b/devtools/server/tests/browser/browser_markers-timestamp.js
@@ -1,24 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get a "TimeStamp" marker.
  */
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const { pmmConsoleMethod, pmmLoadFrameScripts, pmmClearFrameScripts }
   = require("devtools/client/performance/test/helpers/profiler-mm-utils");
 const MARKER_NAME = "TimeStamp";
 
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
   const rec = await front.startRecording({ withMarkers: true });
 
   pmmLoadFrameScripts(gBrowser);
   pmmConsoleMethod("timeStamp");
   pmmConsoleMethod("timeStamp", "myLabel");
 
   const markers = await waitForMarkerType(front, MARKER_NAME, m => m.length >= 2);
@@ -32,11 +36,11 @@ add_task(async function() {
   ok(markers.length === 2, "found 2 TimeStamp markers");
   ok(markers.every(({start, end}) => typeof start === "number" && start === end),
     "All markers have equal start and end times");
   is(markers[0].causeName, void 0, "Unlabeled timestamps have an empty causeName");
   is(markers[1].causeName, "myLabel", "Labeled timestamps have correct causeName");
 
   pmmClearFrameScripts();
 
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-allocation-data.js
+++ b/devtools/server/tests/browser/browser_perf-allocation-data.js
@@ -2,19 +2,25 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we have allocation data coming from the front.
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
-  const target  = await addTabTarget(MAIN_DOMAIN + "doc_allocations.html");
-  const front = target.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_allocations.html");
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   const rec = await front.startRecording(
     { withMarkers: true, withAllocations: true, withTicks: true });
 
   await waitUntil(() => rec.getAllocations().frames.length);
   await waitUntil(() => rec.getAllocations().timestamps.length);
   await waitUntil(() => rec.getAllocations().sizes.length);
@@ -25,11 +31,11 @@ add_task(async function() {
   const { timestamps, sizes } = rec.getAllocations();
 
   is(timestamps.length, sizes.length, "we have the same amount of timestamps and sizes");
   ok(timestamps.every(time => time > 0 && typeof time === "number"),
     "all timestamps have numeric values");
   ok(sizes.every(n => n > 0 && typeof n === "number"), "all sizes are positive numbers");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-profiler-01.js
+++ b/devtools/server/tests/browser/browser_perf-profiler-01.js
@@ -4,22 +4,26 @@
 /**
  * Tests if the profiler connection front does not activate the built-in
  * profiler module if not necessary, and doesn't deactivate it when
  * a recording is stopped.
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const { pmmIsProfilerActive, pmmLoadFrameScripts } = require("devtools/client/performance/test/helpers/profiler-mm-utils");
 
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   pmmLoadFrameScripts(gBrowser);
 
   ok(!(await pmmIsProfilerActive()),
     "The built-in profiler module should not have been automatically started.");
 
   let rec = await front.startRecording();
@@ -28,15 +32,15 @@ add_task(async function() {
     "The built-in profiler module should still be active (1).");
 
   rec = await front.startRecording();
   await front.stopRecording(rec);
   ok((await pmmIsProfilerActive()),
     "The built-in profiler module should still be active (2).");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
 
   ok(!(await pmmIsProfilerActive()),
     "The built-in profiler module should no longer be active.");
 
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-profiler-02.js
+++ b/devtools/server/tests/browser/browser_perf-profiler-02.js
@@ -3,40 +3,46 @@
 
 /**
  * Tests if the built-in profiler module doesn't deactivate when the toolbox
  * is destroyed if there are other consumers using it.
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const { pmmIsProfilerActive, pmmLoadFrameScripts } = require("devtools/client/performance/test/helpers/profiler-mm-utils");
 
 add_task(async function() {
-  const target1 = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
-  const firstFront = target1.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const firstFront = PerformanceFront(client, form);
   await firstFront.connect();
 
   pmmLoadFrameScripts(gBrowser);
 
   await firstFront.startRecording();
 
-  const target2 = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
-  const secondFront = target2.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
+  const client2 = new DebuggerClient(DebuggerServer.connectPipe());
+  const form2 = await connectDebuggerClient(client2);
+  const secondFront = PerformanceFront(client2, form2);
   await secondFront.connect();
   pmmLoadFrameScripts(gBrowser);
 
   await secondFront.startRecording();
 
   // Manually teardown the tabs so we can check profiler status
   await secondFront.destroy();
-  await target2.destroy();
+  await client2.close();
   ok((await pmmIsProfilerActive()),
     "The built-in profiler module should still be active.");
 
   await firstFront.destroy();
-  await target1.destroy();
+  await client.close();
   ok(!(await pmmIsProfilerActive()),
     "The built-in profiler module should no longer be active.");
 
   gBrowser.removeCurrentTab();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-profiler-03.js
+++ b/devtools/server/tests/browser/browser_perf-profiler-03.js
@@ -5,46 +5,52 @@
  * Tests if the built-in profiler module is not reactivated if no other
  * consumer was using it over the remote debugger protocol, and ensures
  * that the actor will work properly even in such cases (e.g. the Gecko Profiler
  * addon was installed and automatically activated the profiler module).
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
 const { pmmIsProfilerActive, pmmStartProfiler, pmmLoadFrameScripts, pmmClearFrameScripts } = require("devtools/client/performance/test/helpers/profiler-mm-utils");
 
 add_task(async function() {
   // Ensure the profiler is already running when the test starts.
   pmmLoadFrameScripts(gBrowser);
   const entries = 1000000;
   const interval = 1;
   const features = ["js"];
   await pmmStartProfiler({ entries, interval, features });
 
   ok((await pmmIsProfilerActive()),
     "The built-in profiler module should still be active.");
 
-  const target1 = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
-  const firstFront = target1.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const firstFront = PerformanceFront(client, form);
   await firstFront.connect();
 
   await firstFront.startRecording();
 
-  const target2 = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
-  const secondFront = target2.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
+  const client2 = new DebuggerClient(DebuggerServer.connectPipe());
+  const form2 = await connectDebuggerClient(client2);
+  const secondFront = PerformanceFront(client2, form2);
   await secondFront.connect();
 
   await secondFront.destroy();
-  await target2.destroy();
+  await client2.close();
   ok((await pmmIsProfilerActive()),
     "The built-in profiler module should still be active.");
 
   await firstFront.destroy();
-  await target1.destroy();
+  await client.close();
   ok(!(await pmmIsProfilerActive()),
     "The built-in profiler module should have been automatically stopped.");
 
   pmmClearFrameScripts();
 
   gBrowser.removeCurrentTab();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-realtime-markers.js
+++ b/devtools/server/tests/browser/browser_perf-realtime-markers.js
@@ -2,20 +2,25 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test functionality of real time markers.
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   let lastMemoryDelta = 0;
   let lastTickDelta = 0;
 
   const counters = {
     markers: [],
     memory: [],
@@ -36,17 +41,17 @@ add_task(async function() {
   await front.stopRecording(rec);
   front.off("timeline-data", handler);
 
   is(counters.markers.length, 1, "one marker event fired.");
   is(counters.memory.length, 3, "three memory events fired.");
   is(counters.ticks.length, 3, "three ticks events fired.");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 
   function handler(name, data) {
     if (name === "markers") {
       if (counters.markers.length >= 1) {
         return;
       }
       ok(data.markers[0].start, "received atleast one marker with `start`");
--- a/devtools/server/tests/browser/browser_perf-recording-actor-01.js
+++ b/devtools/server/tests/browser/browser_perf-recording-actor-01.js
@@ -3,19 +3,25 @@
 
 /**
  * Tests the state of a recording rec from start to finish for recording,
  * completed, and rec data.
  */
 
 "use strict";
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
-  const front = target.getFront("performance");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
+
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   const rec = await front.startRecording(
     { withMarkers: true, withTicks: true, withMemory: true });
   ok(rec.isRecording(), "RecordingModel is recording when created");
   await busyWait(100);
   await waitUntil(() => rec.getMemory().length);
   ok(true, "RecordingModel populates memory while recording");
@@ -60,17 +66,17 @@ add_task(async function() {
   ok(importedModel.isCompleted(), "All imported recordings should be completed");
   ok(!importedModel.isRecording(), "All imported recordings should not be recording");
   ok(importedModel.isImported(), "All imported recordings should be considerd imported");
 
   checkSystemInfo(importedModel, "Host");
   checkSystemInfo(importedModel, "Client");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 function checkSystemInfo(recording, type) {
   const data = recording[`get${type}SystemInfo`]();
   for (const field of ["appid", "apptype", "vendor", "name", "version"]) {
     ok(data[field], `get${type}SystemInfo() has ${field} property`);
   }
--- a/devtools/server/tests/browser/browser_perf-recording-actor-02.js
+++ b/devtools/server/tests/browser/browser_perf-recording-actor-02.js
@@ -5,20 +5,25 @@
  * Test that buffer status is correctly updated in recording models.
  */
 
 "use strict";
 
 var BUFFER_SIZE = 20000;
 var config = { bufferSize: BUFFER_SIZE };
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   await front.setProfilerStatusInterval(10);
   const model = await front.startRecording(config);
   const stats = await once(front, "profiler-status");
   is(stats.totalSize, BUFFER_SIZE,
     `profiler-status event has totalSize: ${stats.totalSize}`);
   ok(stats.position < BUFFER_SIZE,
@@ -44,11 +49,11 @@ add_task(async function() {
   ok(checkCount >= 1, "atleast 1 event were fired until the buffer was filled");
   is(lastBufferStatus, 1, "buffer usage cannot surpass 100%");
   await front.stopRecording(model);
 
   is(front.getBufferUsageForRecording(model), null,
     "buffer usage should be null when no longer recording.");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-samples-01.js
+++ b/devtools/server/tests/browser/browser_perf-samples-01.js
@@ -6,21 +6,26 @@
  * normalized before passed to consumers.
  */
 
 "use strict";
 
 // time in ms
 const WAIT_TIME = 1000;
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [["privacy.reduceTimerPrecision", false]]});
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   // Perform the first recording...
 
   const firstRecording = await front.startRecording();
   const firstRecordingStartTime = firstRecording._startTime;
   info("Started profiling at: " + firstRecordingStartTime);
 
@@ -55,11 +60,11 @@ add_task(async function() {
     "The second recorded sample times were normalized correctly.");
   ok(!secondRecordingSamples.find(
         e => e[TIME_SLOT] + secondRecordingStartTime <= firstRecording.getDuration()
     ),
     "There should be no samples from the first recording in the second one, " +
     "even though the total number of frames did not overflow.");
 
   await front.destroy();
-  await target.destroy();
+  await client.close();
   gBrowser.removeCurrentTab();
 });
--- a/devtools/server/tests/browser/browser_perf-samples-02.js
+++ b/devtools/server/tests/browser/browser_perf-samples-02.js
@@ -7,20 +7,25 @@
  * devtools/client/performance/modules/logic/tree-model.js will have to be changed.
  */
 
 "use strict";
 
 // Time in ms
 const WAIT_TIME = 1000;
 
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+
 add_task(async function() {
-  const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
+  await addTab(MAIN_DOMAIN + "doc_perf.html");
 
-  const front = target.getFront("performance");
+  initDebuggerServer();
+  const client = new DebuggerClient(DebuggerServer.connectPipe());
+  const form = await connectDebuggerClient(client);
+  const front = PerformanceFront(client, form);
   await front.connect();
 
   const rec = await front.startRecording();
   // allow the profiler module to sample some cpu activity
   busyWait(WAIT_TIME);
 
   await front.stopRecording(rec);
   const profile = rec.getProfile();
@@ -38,17 +43,17 @@ add_task(async function() {
       }
     }
   }
 
   ok(sampleCount > 0,
     "At least some samples have been iterated over, checking for root nodes.");
 
   await front.destroy();
-  await target.getFront("performance");
+  await client.close();
   gBrowser.removeCurrentTab();
 });
 
 /**
  * Inflate a particular sample's stack and return an array of strings.
  */
 function getInflatedStackLocations(thread, sample) {
   const stackTable = thread.stackTable;