Bug 1541631 - Part 1: Rename mock threadFront file to better name since it isn't a Front. r=jlast
authorLogan Smyth <loganfsmyth@gmail.com>
Thu, 15 Aug 2019 21:44:47 +0000
changeset 488388 a080eb120278775f4d3df680ad6656be2250a882
parent 488387 eeb6741275a1d04cb23e16751f2670571f3b8ab5
child 488389 98dd6077c4d543f87e1e0841a430747b1c9913ac
push id36443
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 09:48:15 +0000
treeherdermozilla-central@5d4cbfe103bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1541631
milestone70.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
Bug 1541631 - Part 1: Rename mock threadFront file to better name since it isn't a Front. r=jlast Differential Revision: https://phabricator.services.mozilla.com/D42025
devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js
devtools/client/debugger/src/actions/breakpoints/tests/breakpointPositions.spec.js
devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js
devtools/client/debugger/src/actions/pause/tests/pause.spec.js
devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js
devtools/client/debugger/src/actions/sources/tests/newSources.spec.js
devtools/client/debugger/src/actions/sources/tests/prettyPrint.spec.js
devtools/client/debugger/src/actions/sources/tests/querystrings.spec.js
devtools/client/debugger/src/actions/sources/tests/select.spec.js
devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
devtools/client/debugger/src/actions/tests/helpers/threadFront.js
devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js
devtools/client/debugger/src/actions/tests/tabs.spec.js
--- a/devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js
+++ b/devtools/client/debugger/src/actions/ast/tests/setInScopeLines.spec.js
@@ -16,30 +16,30 @@ import {
 } from "../../../utils/test-head";
 
 const { getInScopeLines } = selectors;
 
 const sourceTexts = {
   "scopes.js": readFixture("scopes.js"),
 };
 
-const threadFront = {
+const mockCommandClient = {
   sourceContents: async ({ source }) => ({
     source: sourceTexts[source],
     contentType: "text/javascript",
   }),
   evaluateExpressions: async () => {},
   getFrameScopes: async () => {},
   getBreakpointPositions: async () => ({}),
   getBreakableLines: async () => [],
 };
 
 describe("getInScopeLine", () => {
   it("with selected line", async () => {
-    const store = createStore(threadFront);
+    const store = createStore(mockCommandClient);
     const { dispatch, getState } = store;
     const source = makeMockSource("scopes.js", "scopes.js");
 
     await dispatch(actions.newGeneratedSource(makeSource("scopes.js")));
 
     await dispatch(
       actions.selectLocation(selectors.getContext(getState()), {
         sourceId: "scopes.js",
--- a/devtools/client/debugger/src/actions/breakpoints/tests/breakpointPositions.spec.js
+++ b/devtools/client/debugger/src/actions/breakpoints/tests/breakpointPositions.spec.js
@@ -6,17 +6,17 @@
 
 import {
   actions,
   selectors,
   createStore,
   makeSource,
   waitForState,
 } from "../../../utils/test-head";
-import { createSource } from "../../tests/helpers/threadFront";
+import { createSource } from "../../tests/helpers/mockCommandClient";
 
 describe("breakpointPositions", () => {
   it("fetches positions", async () => {
     const fooContent = createSource("foo", "");
 
     const store = createStore({
       getBreakpointPositions: async () => ({ "9": [1] }),
       getBreakableLines: async () => [],
--- a/devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js
+++ b/devtools/client/debugger/src/actions/breakpoints/tests/breakpoints.spec.js
@@ -7,21 +7,21 @@
 import {
   createStore,
   selectors,
   actions,
   makeSource,
   getTelemetryEvents,
 } from "../../../utils/test-head";
 
-import { simpleMockThreadFront } from "../../tests/helpers/threadFront.js";
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
 
 function mockClient(positionsResponse = {}) {
   return {
-    ...simpleMockThreadFront,
+    ...mockCommandClient,
     getBreakpointPositions: async () => positionsResponse,
     getBreakableLines: async () => [],
   };
 }
 
 describe("breakpoints", () => {
   it("should add a breakpoint", async () => {
     const { dispatch, getState, cx } = createStore(mockClient({ "2": [1] }));
--- a/devtools/client/debugger/src/actions/pause/tests/pause.spec.js
+++ b/devtools/client/debugger/src/actions/pause/tests/pause.spec.js
@@ -17,17 +17,17 @@ import {
 import { makeWhyNormal } from "../../../utils/test-mockup";
 
 import { parserWorker } from "../../../test/tests-setup";
 import { features } from "../../../utils/prefs";
 
 const { isStepping } = selectors;
 
 let stepInResolve = null;
-const mockThreadFront = {
+const mockCommandClient = {
   stepIn: () =>
     new Promise(_resolve => {
       stepInResolve = _resolve;
     }),
   stepOver: () => new Promise(_resolve => _resolve),
   evaluate: async () => {},
   evaluateInFrame: async () => {},
   evaluateExpressions: async () => [],
@@ -99,17 +99,17 @@ function createPauseInfo(
     loadedObjects: [],
     why: makeWhyNormal(),
   };
 }
 
 describe("pause", () => {
   describe("stepping", () => {
     it("should set and clear the command", async () => {
-      const { dispatch, getState } = createStore(mockThreadFront);
+      const { dispatch, getState } = createStore(mockCommandClient);
       const mockPauseInfo = createPauseInfo();
 
       await dispatch(actions.newGeneratedSource(makeSource("foo1")));
       await dispatch(actions.paused(mockPauseInfo));
       const cx = selectors.getThreadContext(getState());
       const stepped = dispatch(actions.stepIn(cx));
       expect(isStepping(getState(), "FakeThread")).toBeTruthy();
       if (!stepInResolve) {
@@ -124,43 +124,43 @@ describe("pause", () => {
       const client = { stepIn: jest.fn() };
       const { dispatch, cx } = createStore(client);
 
       dispatch(actions.stepIn(cx));
       expect(client.stepIn.mock.calls).toHaveLength(0);
     });
 
     it("should step when paused", async () => {
-      const { dispatch, getState } = createStore(mockThreadFront);
+      const { dispatch, getState } = createStore(mockCommandClient);
       const mockPauseInfo = createPauseInfo();
 
       await dispatch(actions.newGeneratedSource(makeSource("foo1")));
       await dispatch(actions.paused(mockPauseInfo));
       const cx = selectors.getThreadContext(getState());
       dispatch(actions.stepIn(cx));
       expect(isStepping(getState(), "FakeThread")).toBeTruthy();
     });
 
     it("should step over when paused", async () => {
-      const store = createStore(mockThreadFront);
+      const store = createStore(mockCommandClient);
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo();
 
       await dispatch(actions.newGeneratedSource(makeSource("foo1")));
       await dispatch(actions.paused(mockPauseInfo));
       const cx = selectors.getThreadContext(getState());
       const getNextStepSpy = jest.spyOn(parserWorker, "getNextStep");
       dispatch(actions.stepOver(cx));
       expect(getNextStepSpy).not.toHaveBeenCalled();
       expect(isStepping(getState(), "FakeThread")).toBeTruthy();
     });
 
     it("should step over when paused before an await", async () => {
       features.asyncStepping = true;
-      const store = createStore(mockThreadFront);
+      const store = createStore(mockCommandClient);
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo({
         sourceId: "await",
         line: 2,
         column: 0,
       });
 
       await dispatch(actions.newGeneratedSource(makeSource("await")));
@@ -170,17 +170,17 @@ describe("pause", () => {
       const getNextStepSpy = jest.spyOn(parserWorker, "getNextStep");
       dispatch(actions.stepOver(cx));
       expect(getNextStepSpy).toHaveBeenCalled();
       getNextStepSpy.mockRestore();
     });
 
     it("should step over when paused after an await", async () => {
       const store = createStore({
-        ...mockThreadFront,
+        ...mockCommandClient,
         getBreakpointPositions: async () => ({ [2]: [1] }),
       });
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo({
         sourceId: "await",
         line: 2,
         column: 6,
       });
@@ -197,17 +197,17 @@ describe("pause", () => {
 
     it("getting frame scopes with bindings", async () => {
       const generatedLocation = {
         sourceId: "foo",
         line: 1,
         column: 0,
       };
 
-      const store = createStore(mockThreadFront, {});
+      const store = createStore(mockCommandClient, {});
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo(generatedLocation, {
         scope: {
           bindings: {
             variables: { b: { value: {} } },
             arguments: [{ a: { value: {} } }],
           },
         },
@@ -274,17 +274,17 @@ describe("pause", () => {
         getOriginalLocations: async items => items,
         getOriginalSourceText: async () => ({
           text: "\n\nfunction fooOriginal() {\n  return -5;\n}",
           contentType: "text/javascript",
         }),
         getGeneratedLocation: async location => location,
       };
 
-      const store = createStore(mockThreadFront, {}, sourceMapsMock);
+      const store = createStore(mockCommandClient, {}, sourceMapsMock);
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo(generatedLocation);
 
       await dispatch(actions.newGeneratedSource(makeSource("foo")));
       await dispatch(actions.newGeneratedSource(makeSource("foo-original")));
 
       await dispatch(actions.paused(mockPauseInfo));
       expect(selectors.getFrames(getState(), "FakeThread")).toEqual([
@@ -335,17 +335,17 @@ describe("pause", () => {
         getOriginalLocations: async items => items,
         getOriginalSourceText: async () => ({
           text: "fn fooBar() {}\nfn barZoo() { fooBar() }",
           contentType: "text/rust",
         }),
         getGeneratedRangesForOriginal: async () => [],
       };
 
-      const store = createStore(mockThreadFront, {}, sourceMapsMock);
+      const store = createStore(mockCommandClient, {}, sourceMapsMock);
       const { dispatch, getState } = store;
       const mockPauseInfo = createPauseInfo(generatedLocation);
 
       const source = await dispatch(
         actions.newGeneratedSource(
           makeSource("foo-wasm", { introductionType: "wasm" })
         )
       );
@@ -378,41 +378,41 @@ describe("pause", () => {
           thread: "FakeThread",
         },
       ]);
     });
   });
 
   describe("resumed", () => {
     it("should not evaluate expression while stepping", async () => {
-      const client = { ...mockThreadFront, evaluateExpressions: jest.fn() };
+      const client = { ...mockCommandClient, evaluateExpressions: jest.fn() };
       const { dispatch, getState } = createStore(client);
       const mockPauseInfo = createPauseInfo();
 
       await dispatch(actions.newGeneratedSource(makeSource("foo1")));
       await dispatch(actions.paused(mockPauseInfo));
 
       const cx = selectors.getThreadContext(getState());
       dispatch(actions.stepIn(cx));
-      await dispatch(actions.resumed(mockThreadFront.actorID));
+      await dispatch(actions.resumed(mockCommandClient.actorID));
       expect(client.evaluateExpressions.mock.calls).toHaveLength(1);
     });
 
     it("resuming - will re-evaluate watch expressions", async () => {
-      const client = { ...mockThreadFront, evaluateExpressions: jest.fn() };
+      const client = { ...mockCommandClient, evaluateExpressions: jest.fn() };
       const store = createStore(client);
       const { dispatch, getState, cx } = store;
       const mockPauseInfo = createPauseInfo();
 
       await dispatch(actions.newGeneratedSource(makeSource("foo1")));
       await dispatch(actions.newGeneratedSource(makeSource("foo")));
       await dispatch(actions.addExpression(cx, "foo"));
       await waitForState(store, state => selectors.getExpression(state, "foo"));
 
       client.evaluateExpressions.mockReturnValue(Promise.resolve(["YAY"]));
       await dispatch(actions.paused(mockPauseInfo));
 
-      await dispatch(actions.resumed(mockThreadFront.actorID));
+      await dispatch(actions.resumed(mockCommandClient.actorID));
       const expression = selectors.getExpression(getState(), "foo");
       expect(expression && expression.value).toEqual("YAY");
     });
   });
 });
--- a/devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js
+++ b/devtools/client/debugger/src/actions/sources/tests/loadSource.spec.js
@@ -9,24 +9,24 @@ import {
   selectors,
   watchForState,
   createStore,
   makeOriginalSource,
   makeSource,
 } from "../../../utils/test-head";
 import {
   createSource,
-  sourceThreadFront,
-} from "../../tests/helpers/threadFront.js";
+  mockCommandClient,
+} from "../../tests/helpers/mockCommandClient";
 import { getBreakpointsList } from "../../../selectors";
 import { isFulfilled, isRejected } from "../../../utils/async-value";
 
 describe("loadSourceText", () => {
   it("should load source text", async () => {
-    const store = createStore(sourceThreadFront);
+    const store = createStore(mockCommandClient);
     const { dispatch, getState, cx } = store;
 
     const foo1Source = await dispatch(
       actions.newGeneratedSource(makeSource("foo1"))
     );
     await dispatch(actions.loadSourceText({ cx, source: foo1Source }));
 
     const foo1Content = selectors.getSourceContent(getState(), foo1Source.id);
@@ -54,17 +54,17 @@ describe("loadSourceText", () => {
   });
 
   it("should update breakpoint text when a source loads", async () => {
     const fooOrigContent = createSource("fooOrig", "var fooOrig = 42;");
     const fooGenContent = createSource("fooGen", "var fooGen = 42;");
 
     const store = createStore(
       {
-        ...sourceThreadFront,
+        ...mockCommandClient,
         sourceContents: async () => fooGenContent,
         getBreakpointPositions: async () => ({ "1": [0] }),
         getBreakableLines: async () => [],
       },
       {},
       {
         getGeneratedRangesForOriginal: async () => [
           { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } },
@@ -218,49 +218,49 @@ describe("loadSourceText", () => {
       content &&
         isFulfilled(content) &&
         content.value.type === "text" &&
         content.value.value
     ).toEqual("yay");
   });
 
   it("should cache subsequent source text loads", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("foo1"))
     );
     await dispatch(actions.loadSourceText({ cx, source }));
     const prevSource = selectors.getSourceFromId(getState(), "foo1");
 
     await dispatch(actions.loadSourceText({ cx, source: prevSource }));
     const curSource = selectors.getSource(getState(), "foo1");
 
     expect(prevSource === curSource).toBeTruthy();
   });
 
   it("should indicate a loading source", async () => {
-    const store = createStore(sourceThreadFront);
+    const store = createStore(mockCommandClient);
     const { dispatch, cx } = store;
 
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("foo2"))
     );
 
     const wasLoading = watchForState(store, state => {
       return !selectors.getSourceContent(state, "foo2");
     });
 
     await dispatch(actions.loadSourceText({ cx, source }));
 
     expect(wasLoading()).toBe(true);
   });
 
   it("should indicate an errored source text", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("bad-id"))
     );
     await dispatch(actions.loadSourceText({ cx, source }));
     const badSource = selectors.getSource(getState(), "bad-id");
 
     const content = badSource
--- a/devtools/client/debugger/src/actions/sources/tests/newSources.spec.js
+++ b/devtools/client/debugger/src/actions/sources/tests/newSources.spec.js
@@ -15,58 +15,57 @@ import {
 const {
   getSource,
   getSourceCount,
   getSelectedSource,
   getSourceByURL,
 } = selectors;
 import sourceQueue from "../../../utils/source-queue";
 
-// eslint-disable-next-line max-len
-import { sourceThreadFront as threadFront } from "../../tests/helpers/threadFront.js";
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
 
 describe("sources - new sources", () => {
   it("should add sources to state", async () => {
-    const { dispatch, getState } = createStore(threadFront);
+    const { dispatch, getState } = createStore(mockCommandClient);
     await dispatch(actions.newGeneratedSource(makeSource("base.js")));
     await dispatch(actions.newGeneratedSource(makeSource("jquery.js")));
 
     expect(getSourceCount(getState())).toEqual(2);
     const base = getSource(getState(), "base.js");
     const jquery = getSource(getState(), "jquery.js");
     expect(base && base.id).toEqual("base.js");
     expect(jquery && jquery.id).toEqual("jquery.js");
   });
 
   it("should not add multiple identical sources", async () => {
-    const { dispatch, getState } = createStore(threadFront);
+    const { dispatch, getState } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("base.js")));
     await dispatch(actions.newGeneratedSource(makeSource("base.js")));
 
     expect(getSourceCount(getState())).toEqual(1);
   });
 
   it("should automatically select a pending source", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
     const baseSourceURL = makeSourceURL("base.js");
     await dispatch(actions.selectSourceURL(cx, baseSourceURL));
 
     expect(getSelectedSource(getState())).toBe(undefined);
     const baseSource = await dispatch(
       actions.newGeneratedSource(makeSource("base.js"))
     );
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.url).toBe(baseSource.url);
   });
 
   it("should add original sources", async () => {
     const { dispatch, getState } = createStore(
-      threadFront,
+      mockCommandClient,
       {},
       {
         getOriginalURLs: async () => ["magic.js"],
         getOriginalLocations: async items => items,
       }
     );
 
     await dispatch(
@@ -77,32 +76,32 @@ describe("sources - new sources", () => 
     const magic = getSourceByURL(getState(), "magic.js");
     expect(magic && magic.url).toEqual("magic.js");
   });
 
   // eslint-disable-next-line
   it("should not attempt to fetch original sources if it's missing a source map url", async () => {
     const getOriginalURLs = jest.fn();
     const { dispatch } = createStore(
-      threadFront,
+      mockCommandClient,
       {},
       {
         getOriginalURLs,
         getOriginalLocations: async items => items,
       }
     );
 
     await dispatch(actions.newGeneratedSource(makeSource("base.js")));
     expect(getOriginalURLs).not.toHaveBeenCalled();
   });
 
   // eslint-disable-next-line
   it("should process new sources immediately, without waiting for source maps to be fetched first", async () => {
     const { dispatch, getState } = createStore(
-      threadFront,
+      mockCommandClient,
       {},
       {
         getOriginalURLs: async () => new Promise(_ => {}),
         getOriginalLocations: async items => items,
       }
     );
     await dispatch(
       actions.newGeneratedSource(
@@ -112,17 +111,17 @@ describe("sources - new sources", () => 
     expect(getSourceCount(getState())).toEqual(1);
     const base = getSource(getState(), "base.js");
     expect(base && base.id).toEqual("base.js");
   });
 
   // eslint-disable-next-line
   it("shouldn't let one slow loading source map delay all the other source maps", async () => {
     const dbg = createStore(
-      threadFront,
+      mockCommandClient,
       {},
       {
         getOriginalURLs: async source => {
           if (source.id == "foo.js") {
             // simulate a hang loading foo.js.map
             return new Promise(_ => {});
           }
 
@@ -148,17 +147,17 @@ describe("sources - new sources", () => 
     const bazzCljs = getSourceByURL(getState(), "bazz.cljs");
     expect(bazzCljs && bazzCljs.url).toEqual("bazz.cljs");
   });
 
   describe("sources - sources with querystrings", () => {
     it(`should find two sources when same source with
       querystring`, async () => {
       const { getSourcesUrlsInSources } = selectors;
-      const { dispatch, getState } = createStore(threadFront);
+      const { dispatch, getState } = createStore(mockCommandClient);
       await dispatch(actions.newGeneratedSource(makeSource("base.js?v=1")));
       await dispatch(actions.newGeneratedSource(makeSource("base.js?v=2")));
       await dispatch(actions.newGeneratedSource(makeSource("diff.js?v=1")));
 
       const base1 = "http://localhost:8000/examples/base.js?v=1";
       const diff1 = "http://localhost:8000/examples/diff.js?v=1";
       const diff2 = "http://localhost:8000/examples/diff.js?v=1";
 
--- a/devtools/client/debugger/src/actions/sources/tests/prettyPrint.spec.js
+++ b/devtools/client/debugger/src/actions/sources/tests/prettyPrint.spec.js
@@ -6,22 +6,22 @@
 
 import {
   actions,
   selectors,
   createStore,
   makeSource,
 } from "../../../utils/test-head";
 import { createPrettySource } from "../prettyPrint";
-import { sourceThreadFront } from "../../tests/helpers/threadFront.js";
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
 import { isFulfilled } from "../../../utils/async-value";
 
 describe("sources - pretty print", () => {
   it("returns a pretty source for a minified file", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const url = "base.js";
     const source = await dispatch(actions.newGeneratedSource(makeSource(url)));
     await dispatch(actions.loadSourceText({ cx, source }));
 
     await dispatch(createPrettySource(cx, source.id));
 
     const prettyURL = `${source.url}:formatted`;
@@ -37,29 +37,29 @@ describe("sources - pretty print", () =>
         isFulfilled(content) &&
         content.value.type === "text" &&
         content.value.contentType
     ).toEqual("text/javascript");
     expect(content).toMatchSnapshot();
   });
 
   it("should create a source when first toggling pretty print", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("foobar.js"))
     );
     await dispatch(actions.loadSourceText({ cx, source }));
 
     await dispatch(actions.togglePrettyPrint(cx, source.id));
     expect(selectors.getSourceCount(getState())).toEqual(2);
   });
 
   it("should not make a second source when toggling pretty print", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("foobar.js"))
     );
     await dispatch(actions.loadSourceText({ cx, source }));
 
     await dispatch(actions.togglePrettyPrint(cx, source.id));
     expect(selectors.getSourceCount(getState())).toEqual(2);
--- a/devtools/client/debugger/src/actions/sources/tests/querystrings.spec.js
+++ b/devtools/client/debugger/src/actions/sources/tests/querystrings.spec.js
@@ -8,21 +8,21 @@ import {
   actions,
   selectors,
   createStore,
   makeSource,
 } from "../../../utils/test-head";
 const { getSourcesUrlsInSources } = selectors;
 
 // eslint-disable-next-line max-len
-import { sourceThreadFront as threadFront } from "../../tests/helpers/threadFront.js";
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
 
 describe("sources - sources with querystrings", () => {
   it("should find two sources when same source with querystring", async () => {
-    const { dispatch, getState } = createStore(threadFront);
+    const { dispatch, getState } = createStore(mockCommandClient);
     await dispatch(actions.newGeneratedSource(makeSource("base.js?v=1")));
     await dispatch(actions.newGeneratedSource(makeSource("base.js?v=2")));
     await dispatch(actions.newGeneratedSource(makeSource("diff.js?v=1")));
 
     expect(
       getSourcesUrlsInSources(
         getState(),
         "http://localhost:8000/examples/base.js?v=1"
--- a/devtools/client/debugger/src/actions/sources/tests/select.spec.js
+++ b/devtools/client/debugger/src/actions/sources/tests/select.spec.js
@@ -18,29 +18,29 @@ import {
 const {
   getSource,
   getSourceCount,
   getSelectedSource,
   getSourceTabs,
   getSelectedLocation,
 } = selectors;
 
-import { sourceThreadFront } from "../../tests/helpers/threadFront.js";
+import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
 
 process.on("unhandledRejection", (reason, p) => {});
 
 function initialLocation(sourceId) {
   return { sourceId, line: 1 };
 }
 
 describe("sources", () => {
   it("should select a source", async () => {
     // Note that we pass an empty client in because the action checks
     // if it exists.
-    const store = createStore(sourceThreadFront);
+    const store = createStore(mockCommandClient);
     const { dispatch, getState } = store;
 
     const frame = makeFrame({ id: "1", sourceId: "foo1" });
 
     await dispatch(actions.newGeneratedSource(makeSource("foo1")));
     await dispatch(
       actions.paused({
         thread: "FakeThread",
@@ -64,17 +64,17 @@ describe("sources", () => {
     const source = getSource(getState(), selectedSource.id);
     if (!source) {
       throw new Error("bad source");
     }
     expect(source.id).toEqual("foo1");
   });
 
   it("should select next tab on tab closed if no previous tab", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const fooSource = await dispatch(
       actions.newGeneratedSource(makeSource("foo.js"))
     );
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     await dispatch(actions.newGeneratedSource(makeSource("baz.js")));
 
     // 3rd tab
@@ -93,27 +93,27 @@ describe("sources", () => {
     await dispatch(actions.closeTab(cx, fooSource));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("bar.js");
     expect(getSourceTabs(getState())).toHaveLength(2);
   });
 
   it("should open a tab for the source", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
 
     const tabs = getSourceTabs(getState());
     expect(tabs).toHaveLength(1);
     expect(tabs[0].url).toEqual("http://localhost:8000/examples/foo.js");
   });
 
   it("should select previous tab on tab closed", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
 
     const bazSource = await dispatch(
       actions.newGeneratedSource(makeSource("baz.js"))
     );
 
     await dispatch(actions.selectLocation(cx, initialLocation("foo.js")));
@@ -122,17 +122,17 @@ describe("sources", () => {
     await dispatch(actions.closeTab(cx, bazSource));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("bar.js");
     expect(getSourceTabs(getState())).toHaveLength(2);
   });
 
   it("should keep the selected source when other tab closed", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     const bazSource = await dispatch(
       actions.newGeneratedSource(makeSource("baz.js"))
     );
 
     // 3rd tab
@@ -149,32 +149,32 @@ describe("sources", () => {
     await dispatch(actions.closeTab(cx, bazSource));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("foo.js");
     expect(getSourceTabs(getState())).toHaveLength(2);
   });
 
   it("should not select new sources that lack a URL", async () => {
-    const { dispatch, getState } = createStore(sourceThreadFront);
+    const { dispatch, getState } = createStore(mockCommandClient);
 
     await dispatch(
       actions.newGeneratedSource({
         ...makeSource("foo"),
         url: "",
       })
     );
 
     expect(getSourceCount(getState())).toEqual(1);
     const selectedLocation = getSelectedLocation(getState());
     expect(selectedLocation).toEqual(undefined);
   });
 
   it("sets and clears selected location correctly", async () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
     const source = await dispatch(
       actions.newGeneratedSource(makeSource("testSource"))
     );
     const location = ({ test: "testLocation" }: any);
 
     // set value
     dispatch(actions.setSelectedLocation(cx, source, location));
     expect(getSelectedLocation(getState())).toEqual({
@@ -183,17 +183,17 @@ describe("sources", () => {
     });
 
     // clear value
     dispatch(actions.clearSelectedLocation(cx));
     expect(getSelectedLocation(getState())).toEqual(null);
   });
 
   it("sets and clears pending selected location correctly", () => {
-    const { dispatch, getState, cx } = createStore(sourceThreadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
     const url = "testURL";
     const options = { location: { line: "testLine" } };
 
     // set value
     dispatch(actions.setPendingSelectedLocation(cx, url, options));
     const setResult = getState().sources.pendingSelectedLocation;
     expect(setResult).toEqual({
       url,
@@ -202,34 +202,34 @@ describe("sources", () => {
 
     // clear value
     dispatch(actions.clearSelectedLocation(cx));
     const clearResult = getState().sources.pendingSelectedLocation;
     expect(clearResult).toEqual({ url: "" });
   });
 
   it("should keep the generated the viewing context", async () => {
-    const store = createStore(sourceThreadFront);
+    const store = createStore(mockCommandClient);
     const { dispatch, getState, cx } = store;
     const baseSource = await dispatch(
       actions.newGeneratedSource(makeSource("base.js"))
     );
 
     await dispatch(
       actions.selectLocation(cx, { sourceId: baseSource.id, line: 1 })
     );
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe(baseSource.id);
     await waitForState(store, state => getSymbols(state, baseSource));
   });
 
   it("should keep the original the viewing context", async () => {
     const { dispatch, getState, cx } = createStore(
-      sourceThreadFront,
+      mockCommandClient,
       {},
       {
         getOriginalLocation: async location => ({ ...location, line: 12 }),
         getOriginalLocations: async items => items,
         getGeneratedLocation: async location => ({ ...location, line: 12 }),
         getOriginalSourceText: async () => ({ text: "" }),
         getGeneratedRangesForOriginal: async () => [],
       }
@@ -253,17 +253,17 @@ describe("sources", () => {
     );
 
     const selected = getSelectedLocation(getState());
     expect(selected && selected.line).toBe(12);
   });
 
   it("should change the original the viewing context", async () => {
     const { dispatch, getState, cx } = createStore(
-      sourceThreadFront,
+      mockCommandClient,
       {},
       {
         getOriginalLocation: async location => ({ ...location, line: 12 }),
         getOriginalLocations: async items => items,
         getGeneratedRangesForOriginal: async () => [],
         getOriginalSourceText: async () => ({ text: "" }),
       }
     );
@@ -285,17 +285,17 @@ describe("sources", () => {
     );
 
     const selected = getSelectedLocation(getState());
     expect(selected && selected.line).toBe(1);
   });
 
   describe("selectSourceURL", () => {
     it("should automatically select a pending source", async () => {
-      const { dispatch, getState, cx } = createStore(sourceThreadFront);
+      const { dispatch, getState, cx } = createStore(mockCommandClient);
       const baseSourceURL = makeSourceURL("base.js");
       await dispatch(actions.selectSourceURL(cx, baseSourceURL));
 
       expect(getSelectedSource(getState())).toBe(undefined);
       const baseSource = await dispatch(
         actions.newGeneratedSource(makeSource("base.js"))
       );
 
rename from devtools/client/debugger/src/actions/tests/helpers/threadFront.js
rename to devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
--- a/devtools/client/debugger/src/actions/tests/helpers/threadFront.js
+++ b/devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
@@ -1,19 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
-import type {
-  SourceActor,
-  SourceActorLocation,
-  BreakpointOptions,
-} from "../../../types";
+import type { SourceActor } from "../../../types";
 
 export function createSource(name: string, code?: string) {
   name = name.replace(/\..*$/, "");
   return {
     source: code || `function ${name}() {\n  return ${name} \n}`,
     contentType: "text/javascript",
   };
 }
@@ -31,53 +27,28 @@ const sources = [
   "barfoo.js",
   "foo.js",
   "bar.js",
   "base.js",
   "bazz.js",
   "jquery.js",
 ];
 
-export const simpleMockThreadFront = {
-  getBreakpointByLocation: (jest.fn(): any),
-  setBreakpoint: (location: SourceActorLocation, _condition: string) =>
-    Promise.resolve({ id: "hi", actualLocation: location }),
-
-  removeBreakpoint: (_id: string) => Promise.resolve(),
-
-  setBreakpointOptions: (
-    _id: string,
-    _location: SourceActorLocation,
-    _options: BreakpointOptions,
-    _noSliding: boolean
-  ) => Promise.resolve({ sourceId: "a", line: 5 }),
-  sourceContents: ({
-    source,
-  }: SourceActor): Promise<{| source: any, contentType: ?string |}> =>
-    new Promise((resolve, reject) => {
-      if (sources.includes(source)) {
-        resolve(createSource(source));
-      }
-
-      reject(`unknown source: ${source}`);
-    }),
-};
-
-// sources and tabs
-export const sourceThreadFront = {
+export const mockCommandClient = {
   sourceContents: function({
     source,
   }: SourceActor): Promise<{| source: any, contentType: ?string |}> {
     return new Promise((resolve, reject) => {
       if (sources.includes(source)) {
         resolve(createSource(source));
       }
 
       reject(`unknown source: ${source}`);
     });
   },
   setBreakpoint: async () => {},
+  removeBreakpoint: (_id: string) => Promise.resolve(),
   threadFront: async () => {},
   getFrameScopes: async () => {},
   evaluateExpressions: async () => {},
   getBreakpointPositions: async () => ({}),
   getBreakableLines: async () => [],
 };
--- a/devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js
+++ b/devtools/client/debugger/src/actions/tests/pending-breakpoints.spec.js
@@ -5,17 +5,17 @@
 // @flow
 
 // TODO: we would like to mock this in the local tests
 import {
   generateBreakpoint,
   mockPendingBreakpoint,
 } from "./helpers/breakpoints.js";
 
-import { simpleMockThreadFront } from "./helpers/threadFront.js";
+import { mockCommandClient } from "./helpers/mockCommandClient";
 
 import { asyncStore } from "../../utils/prefs";
 
 function loadInitialState(opts = {}) {
   const mockedPendingBreakpoint = mockPendingBreakpoint({ ...opts, column: 2 });
   const id = makePendingLocationId(mockedPendingBreakpoint.location);
   asyncStore.pendingBreakpoints = { [id]: mockedPendingBreakpoint };
 
@@ -42,17 +42,17 @@ import {
   waitForState,
 } from "../../utils/test-head";
 
 import sourceMaps from "devtools-source-map";
 
 import { makePendingLocationId } from "../../utils/breakpoint";
 function mockClient(bpPos = {}) {
   return {
-    ...simpleMockThreadFront,
+    ...mockCommandClient,
 
     getBreakpointPositions: async () => bpPos,
     getBreakableLines: async () => [],
   };
 }
 
 function mockSourceMaps() {
   return {
--- a/devtools/client/debugger/src/actions/tests/tabs.spec.js
+++ b/devtools/client/debugger/src/actions/tests/tabs.spec.js
@@ -7,79 +7,79 @@
 import {
   actions,
   selectors,
   createStore,
   makeSource,
 } from "../../utils/test-head";
 const { getSelectedSource, getSourceTabs } = selectors;
 
-import { sourceThreadFront as threadFront } from "./helpers/threadFront.js";
+import { mockCommandClient } from "./helpers/mockCommandClient";
 
 describe("closing tabs", () => {
   it("closing a tab", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const fooSource = await dispatch(
       actions.newGeneratedSource(makeSource("foo.js"))
     );
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     dispatch(actions.closeTab(cx, fooSource));
 
     expect(getSelectedSource(getState())).toBe(undefined);
     expect(getSourceTabs(getState())).toHaveLength(0);
   });
 
   it("closing the inactive tab", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const fooSource = await dispatch(
       actions.newGeneratedSource(makeSource("foo.js"))
     );
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     await dispatch(actions.selectLocation(cx, { sourceId: "bar.js", line: 1 }));
     dispatch(actions.closeTab(cx, fooSource));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("bar.js");
     expect(getSourceTabs(getState())).toHaveLength(1);
   });
 
   it("closing the only tab", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     const fooSource = await dispatch(
       actions.newGeneratedSource(makeSource("foo.js"))
     );
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     dispatch(actions.closeTab(cx, fooSource));
 
     expect(getSelectedSource(getState())).toBe(undefined);
     expect(getSourceTabs(getState())).toHaveLength(0);
   });
 
   it("closing the active tab", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     const barSource = await dispatch(
       actions.newGeneratedSource(makeSource("bar.js"))
     );
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     await dispatch(actions.selectLocation(cx, { sourceId: "bar.js", line: 1 }));
     await dispatch(actions.closeTab(cx, barSource));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("foo.js");
     expect(getSourceTabs(getState())).toHaveLength(1);
   });
 
   it("closing many inactive tabs", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bazz.js")));
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     await dispatch(actions.selectLocation(cx, { sourceId: "bar.js", line: 1 }));
     await dispatch(
       actions.selectLocation(cx, { sourceId: "bazz.js", line: 1 })
@@ -92,17 +92,17 @@ describe("closing tabs", () => {
     dispatch(actions.closeTabs(cx, tabs));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("bazz.js");
     expect(getSourceTabs(getState())).toHaveLength(1);
   });
 
   it("closing many tabs including the active tab", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bazz.js")));
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     await dispatch(actions.selectLocation(cx, { sourceId: "bar.js", line: 1 }));
     await dispatch(
       actions.selectLocation(cx, { sourceId: "bazz.js", line: 1 })
@@ -114,17 +114,17 @@ describe("closing tabs", () => {
     await dispatch(actions.closeTabs(cx, tabs));
 
     const selected = getSelectedSource(getState());
     expect(selected && selected.id).toBe("foo.js");
     expect(getSourceTabs(getState())).toHaveLength(1);
   });
 
   it("closing all the tabs", async () => {
-    const { dispatch, getState, cx } = createStore(threadFront);
+    const { dispatch, getState, cx } = createStore(mockCommandClient);
 
     await dispatch(actions.newGeneratedSource(makeSource("foo.js")));
     await dispatch(actions.newGeneratedSource(makeSource("bar.js")));
     await dispatch(actions.selectLocation(cx, { sourceId: "foo.js", line: 1 }));
     await dispatch(actions.selectLocation(cx, { sourceId: "bar.js", line: 1 }));
     await dispatch(
       actions.closeTabs(cx, [
         "http://localhost:8000/examples/foo.js",