Bug 1494796 - Use promise pattern rather than callback pattern for threadClient methods; r=ochameau
authoryulia <ystartsev@mozilla.com>
Thu, 02 May 2019 15:39:20 +0000
changeset 531133 92678c01ead789b2951fe1880c30d5251d2e5785
parent 531132 735a7dedf5c4a46dcc0ae1b95202455b056f614b
child 531134 47e694cadae621df8240af8bd4446a988d7631b2
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1494796
milestone68.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 1494796 - Use promise pattern rather than callback pattern for threadClient methods; r=ochameau This is preparation for moving the threadClient to a front. Fronts do not support the callback style that clients have, they only support promises. As such, this patch migrates all instances of the threadClient using callback style methods to promises. I have cc'd the debugger team so that they are aware of this change and it doesn't take them by surprise. try run : https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=242251058&revision=dbd6cca9619ca0880e920d5b86fc6d6e0c728113 Differential Revision: https://phabricator.services.mozilla.com/D28966
devtools/client/debugger/src/client/firefox/commands.js
devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js
devtools/client/framework/devtools-browser.js
devtools/docs/backend/client-api.md
devtools/server/tests/unit/test_blackboxing-02.js
devtools/server/tests/unit/test_blackboxing-03.js
devtools/server/tests/unit/test_blackboxing-04.js
devtools/server/tests/unit/test_blackboxing-05.js
devtools/server/tests/unit/test_breakpoint-03.js
devtools/server/tests/unit/test_breakpoint-04.js
devtools/server/tests/unit/test_breakpoint-05.js
devtools/server/tests/unit/test_breakpoint-06.js
devtools/server/tests/unit/test_breakpoint-07.js
devtools/server/tests/unit/test_breakpoint-08.js
devtools/server/tests/unit/test_breakpoint-09.js
devtools/server/tests/unit/test_breakpoint-10.js
devtools/server/tests/unit/test_breakpoint-11.js
devtools/server/tests/unit/test_breakpoint-12.js
devtools/server/tests/unit/test_breakpoint-13.js
devtools/server/tests/unit/test_breakpoint-14.js
devtools/server/tests/unit/test_breakpoint-16.js
devtools/server/tests/unit/test_breakpoint-17.js
devtools/server/tests/unit/test_conditional_breakpoint-01.js
devtools/server/tests/unit/test_conditional_breakpoint-02.js
devtools/server/tests/unit/test_conditional_breakpoint-03.js
devtools/server/tests/unit/test_frameactor-01.js
devtools/server/tests/unit/test_frameactor-02.js
devtools/server/tests/unit/test_frameactor-03.js
devtools/server/tests/unit/test_frameactor-04.js
devtools/server/tests/unit/test_frameactor-05.js
devtools/server/tests/unit/test_frameactor_wasm-01.js
devtools/server/tests/unit/test_framearguments-01.js
devtools/server/tests/unit/test_framebindings-01.js
devtools/server/tests/unit/test_framebindings-02.js
devtools/server/tests/unit/test_framebindings-03.js
devtools/server/tests/unit/test_framebindings-04.js
devtools/server/tests/unit/test_framebindings-05.js
devtools/server/tests/unit/test_framebindings-06.js
devtools/server/tests/unit/test_framebindings-07.js
devtools/server/tests/unit/test_functiongrips-01.js
devtools/server/tests/unit/test_interrupt.js
devtools/server/tests/unit/test_listsources-01.js
devtools/server/tests/unit/test_listsources-02.js
devtools/server/tests/unit/test_listsources-03.js
devtools/server/tests/unit/test_longstringgrips-01.js
devtools/server/tests/unit/test_nesting-03.js
devtools/server/tests/unit/test_objectgrips-01.js
devtools/server/tests/unit/test_objectgrips-02.js
devtools/server/tests/unit/test_objectgrips-03.js
devtools/server/tests/unit/test_objectgrips-04.js
devtools/server/tests/unit/test_objectgrips-05.js
devtools/server/tests/unit/test_objectgrips-06.js
devtools/server/tests/unit/test_objectgrips-07.js
devtools/server/tests/unit/test_objectgrips-08.js
devtools/server/tests/unit/test_objectgrips-10.js
devtools/server/tests/unit/test_objectgrips-11.js
devtools/server/tests/unit/test_objectgrips-12.js
devtools/server/tests/unit/test_objectgrips-13.js
devtools/server/tests/unit/test_pause_exceptions-01.js
devtools/server/tests/unit/test_pause_exceptions-02.js
devtools/server/tests/unit/test_pauselifetime-01.js
devtools/server/tests/unit/test_pauselifetime-02.js
devtools/server/tests/unit/test_pauselifetime-03.js
devtools/server/tests/unit/test_pauselifetime-04.js
devtools/server/tests/unit/test_source-01.js
devtools/server/tests/unit/test_source-02.js
devtools/server/tests/unit/test_stepping-05.js
devtools/server/tests/unit/test_threadlifetime-01.js
devtools/server/tests/unit/test_threadlifetime-02.js
devtools/server/tests/unit/test_threadlifetime-04.js
devtools/server/tests/unit/test_wasm_source-01.js
devtools/server/tests/unit/test_xpcshell_debugging.js
devtools/shared/client/thread-client.js
--- a/devtools/client/debugger/src/client/firefox/commands.js
+++ b/devtools/client/debugger/src/client/firefox/commands.js
@@ -120,61 +120,45 @@ function forEachWorkerThread(iteratee) {
   // Currently, worker threads are not guaranteed to respond to all requests,
   // if we send a request while they are shutting down. See bug 1529163.
   if (shouldWaitForWorkers) {
     return Promise.all(promises);
   }
 }
 
 function resume(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).resume(resolve);
-  });
+  return lookupThreadClient(thread).resume();
 }
 
 function stepIn(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).stepIn(resolve);
-  });
+  return lookupThreadClient(thread).stepIn();
 }
 
 function stepOver(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).stepOver(resolve);
-  });
+  return lookupThreadClient(thread).stepOver();
 }
 
 function stepOut(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).stepOut(resolve);
-  });
+  return lookupThreadClient(thread).stepOut();
 }
 
 function rewind(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).rewind(resolve);
-  });
+  return lookupThreadClient(thread).rewind();
 }
 
 function reverseStepIn(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).reverseStepIn(resolve);
-  });
+  return lookupThreadClient(thread).reverseStepIn();
 }
 
 function reverseStepOver(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).reverseStepOver(resolve);
-  });
+  return lookupThreadClient(thread).reverseStepOver();
 }
 
 function reverseStepOut(thread: string): Promise<*> {
-  return new Promise(resolve => {
-    lookupThreadClient(thread).reverseStepOut(resolve);
-  });
+  return lookupThreadClient(thread).reverseStepOut();
 }
 
 function breakOnNext(thread: string): Promise<*> {
   return lookupThreadClient(thread).breakOnNext();
 }
 
 async function sourceContents({
   actor,
--- a/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js
@@ -28,20 +28,19 @@ function initDebuggerClient() {
 function onNewSource(event, packet) {
   if (packet.source.url.startsWith("chrome:")) {
     ok(true, "Received a new chrome source: " + packet.source.url);
     gThreadClient.removeListener("newSource", onNewSource);
     gNewChromeSource.resolve();
   }
 }
 
-function resumeAndCloseConnection() {
-  return new Promise(resolve => {
-    gThreadClient.resume(() => resolve(gClient.close()));
-  });
+async function resumeAndCloseConnection() {
+  await gThreadClient.resume();
+  return gClient.close();
 }
 
 registerCleanupFunction(function() {
   gClient = null;
   gThreadClient = null;
   gNewChromeSource = null;
 
   customLoader = null;
--- a/devtools/client/framework/devtools-browser.js
+++ b/devtools/client/framework/devtools-browser.js
@@ -495,25 +495,25 @@ var gDevToolsBrowser = exports.gDevTools
         switch (threadClient.state) {
           case "paused":
             // When the debugger is already paused.
             threadClient.resumeThenPause();
             callback();
             break;
           case "attached":
             // When the debugger is already open.
-            threadClient.interrupt(() => {
+            threadClient.interrupt().then(() => {
               threadClient.resumeThenPause();
               callback();
             });
             break;
           case "resuming":
             // The debugger is newly opened.
             threadClient.addOneTimeListener("resumed", () => {
-              threadClient.interrupt(() => {
+              threadClient.interrupt().then(() => {
                 threadClient.resumeThenPause();
                 callback();
               });
             });
             break;
           default:
             throw Error("invalid thread client state in slow script debug handler: " +
                         threadClient.state);
--- a/devtools/docs/backend/client-api.md
+++ b/devtools/docs/backend/client-api.md
@@ -194,19 +194,19 @@ function debugTab() {
   });
 }
 
 /**
  * Handler for location changes.
  */
 function onTab() {
   // Detach from the previous thread.
-  client.activeThread.detach(() => {
+  client.activeThread.detach().then(() => {
     // Detach from the previous tab.
-    client.detach(() => {
+    client.detach().then(() => {
       // Start debugging the new tab.
       debugTab();
     });
   });
 }
 
 /**
  * Helper function to inspect the provided frame.
--- a/devtools/server/tests/unit/test_blackboxing-02.js
+++ b/devtools/server/tests/unit/test_blackboxing-02.js
@@ -30,17 +30,17 @@ function run_test() {
 }
 
 const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
 const SOURCE_URL = "http://example.com/source.js";
 
 function test_black_box() {
   gClient.addOneTimeListener("paused", async function(event, packet) {
     gThreadClient.setBreakpoint({ sourceUrl: BLACK_BOXED_URL, line: 2 }, {});
-    gThreadClient.resume(test_black_box_breakpoint);
+    gThreadClient.resume().then(test_black_box_breakpoint);
   });
 
   /* eslint-disable no-multi-spaces, no-undef */
   Cu.evalInSandbox(
     "" + function doStuff(k) { // line 1
       const arg = 15;            // line 2 - Break here
       k(arg);                  // line 3
     },                         // line 4
@@ -63,43 +63,45 @@ function test_black_box() {
     "1.8",
     SOURCE_URL,
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
 function test_black_box_breakpoint() {
-  gThreadClient.getSources(async function({error, sources}) {
+  gThreadClient.getSources().then(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
     const sourceFront = gThreadClient.source(
       sources.filter(s => s.url == BLACK_BOXED_URL)[0]
     );
 
     await blackBox(sourceFront);
 
     gClient.addOneTimeListener("paused", function(event, packet) {
       Assert.equal(
         packet.why.type, "debuggerStatement",
         "We should pass over the breakpoint since the source is black boxed.");
-      gThreadClient.resume(test_unblack_box_breakpoint.bind(null, sourceFront));
+      gThreadClient.resume().then(test_unblack_box_breakpoint.bind(null, sourceFront));
     });
     gDebuggee.runTest();
   });
 }
 
 async function test_unblack_box_breakpoint(sourceFront) {
   await unBlackBox(sourceFront);
   gClient.addOneTimeListener("paused", function(event, packet) {
     Assert.equal(packet.why.type, "breakpoint",
                  "We should hit the breakpoint again");
 
     // We will hit the debugger statement on resume, so do this
     // nastiness to skip over it.
     gClient.addOneTimeListener(
       "paused",
-      gThreadClient.resume.bind(
-        gThreadClient,
-        finishClient.bind(null, gClient)));
+      async () => {
+        await gThreadClient.resume();
+        finishClient(gClient);
+      }
+    );
     gThreadClient.resume();
   });
   gDebuggee.runTest();
 }
--- a/devtools/server/tests/unit/test_blackboxing-03.js
+++ b/devtools/server/tests/unit/test_blackboxing-03.js
@@ -61,35 +61,33 @@ function test_black_box() {
     gDebuggee,
     "1.8",
     SOURCE_URL,
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
-function test_black_box_dbg_statement() {
-  gThreadClient.getSources(async function({error, sources}) {
-    Assert.ok(!error, "Should not get an error: " + error);
-    const sourceFront = await getSource(gThreadClient, BLACK_BOXED_URL);
+async function test_black_box_dbg_statement() {
+  await gThreadClient.getSources();
+  const sourceFront = await getSource(gThreadClient, BLACK_BOXED_URL);
 
-    await blackBox(sourceFront);
+  await blackBox(sourceFront);
 
-    gThreadClient.addOneTimeListener("paused", async function(event, packet) {
-      Assert.equal(packet.why.type, "breakpoint",
-                   "We should pass over the debugger statement.");
+  gThreadClient.addOneTimeListener("paused", async function(event, packet) {
+    Assert.equal(packet.why.type, "breakpoint",
+                 "We should pass over the debugger statement.");
 
-      const source = await getSourceById(gThreadClient, packet.frame.where.actor);
-      gThreadClient.removeBreakpoint({ sourceUrl: source.url, line: 4 }, {});
+    const source = await getSourceById(gThreadClient, packet.frame.where.actor);
+    gThreadClient.removeBreakpoint({ sourceUrl: source.url, line: 4 }, {});
 
-      await gThreadClient.resume();
-      await test_unblack_box_dbg_statement(sourceFront);
-    });
-    gDebuggee.runTest();
+    await gThreadClient.resume();
+    await test_unblack_box_dbg_statement(sourceFront);
   });
+  gDebuggee.runTest();
 }
 
 async function test_unblack_box_dbg_statement(sourceFront) {
   await unBlackBox(sourceFront);
 
   gClient.addOneTimeListener("paused", function(event, packet) {
     Assert.equal(packet.why.type, "debuggerStatement",
                  "We should stop at the debugger statement again");
--- a/devtools/server/tests/unit/test_blackboxing-04.js
+++ b/devtools/server/tests/unit/test_blackboxing-04.js
@@ -60,17 +60,17 @@ function test_black_box() {
     "1.8",
     SOURCE_URL,
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
 function test_black_box_paused() {
-  gThreadClient.getSources(async function({error, sources}) {
+  gThreadClient.getSources().then(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
     const sourceFront = gThreadClient.source(
       sources.filter(s => s.url == BLACK_BOXED_URL)[0]
     );
 
     const pausedInSource = await blackBox(sourceFront);
     Assert.ok(pausedInSource,
       "We should be notified that we are currently paused in this source");
--- a/devtools/server/tests/unit/test_blackboxing-05.js
+++ b/devtools/server/tests/unit/test_blackboxing-05.js
@@ -64,17 +64,17 @@ function test_black_box() {
     "1.8",
     SOURCE_URL,
     1
   );
   /* eslint-enable no-multi-spaces, no-unreachable, no-undef */
 }
 
 function test_black_box_exception() {
-  gThreadClient.getSources(async function({error, sources}) {
+  gThreadClient.getSources().then(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
     const sourceFront = await getSource(gThreadClient, BLACK_BOXED_URL);
     await blackBox(sourceFront);
     gThreadClient.pauseOnExceptions(true, false);
 
     gClient.addOneTimeListener("paused", async function(event, packet) {
       const source = await getSourceById(gThreadClient, packet.frame.where.actor);
 
--- a/devtools/server/tests/unit/test_breakpoint-03.js
+++ b/devtools/server/tests/unit/test_breakpoint-03.js
@@ -46,17 +46,17 @@ add_task(threadClientTest(({ threadClien
         Assert.equal(packet.why.type, "breakpoint");
         Assert.equal(packet.why.actors[0], bpClient.actor);
         // Check that the breakpoint worked.
         Assert.equal(debuggee.a, 1);
         Assert.equal(debuggee.b, undefined);
 
         // Remove the breakpoint.
         bpClient.remove(function(response) {
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
       });
 
       threadClient.resume();
     });
 
     // Use `evalInSandbox` to make the debugger treat it as normal
     // globally-scoped code, where breakpoint sliding rules apply.
--- a/devtools/server/tests/unit/test_breakpoint-04.js
+++ b/devtools/server/tests/unit/test_breakpoint-04.js
@@ -26,17 +26,17 @@ add_task(threadClientTest(({ threadClien
         Assert.equal(packet.frame.where.line, location.line);
         Assert.equal(packet.why.type, "breakpoint");
         // Check that the breakpoint worked.
         Assert.equal(debuggee.a, 1);
         Assert.equal(debuggee.b, undefined);
 
         // Remove the breakpoint.
         threadClient.removeBreakpoint(location);
-        threadClient.resume(resolve);
+        threadClient.resume().then(resolve);
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
     });
 
     /* eslint-disable */
     Cu.evalInSandbox(
--- a/devtools/server/tests/unit/test_breakpoint-05.js
+++ b/devtools/server/tests/unit/test_breakpoint-05.js
@@ -31,17 +31,17 @@ add_task(threadClientTest(({ threadClien
           Assert.equal(packet.why.type, "breakpoint");
           Assert.equal(packet.why.actors[0], bpClient.actor);
           // Check that the breakpoint worked.
           Assert.equal(debuggee.a, 1);
           Assert.equal(debuggee.b, undefined);
 
           // Remove the breakpoint.
           bpClient.remove(function(response) {
-            threadClient.resume(resolve);
+            threadClient.resume().then(resolve);
           });
         });
 
         // Continue until the breakpoint is hit.
         threadClient.resume();
       });
     });
 
--- a/devtools/server/tests/unit/test_breakpoint-06.js
+++ b/devtools/server/tests/unit/test_breakpoint-06.js
@@ -31,17 +31,17 @@ add_task(threadClientTest(({ threadClien
           Assert.equal(packet.why.type, "breakpoint");
           Assert.equal(packet.why.actors[0], bpClient.actor);
           // Check that the breakpoint worked.
           Assert.equal(debuggee.a, 1);
           Assert.equal(debuggee.b, undefined);
 
           // Remove the breakpoint.
           bpClient.remove(function(response) {
-            threadClient.resume(resolve);
+            threadClient.resume().then(resolve);
           });
         });
 
         // Continue until the breakpoint is hit.
         threadClient.resume();
       });
     });
 
--- a/devtools/server/tests/unit/test_breakpoint-07.js
+++ b/devtools/server/tests/unit/test_breakpoint-07.js
@@ -31,17 +31,17 @@ add_task(threadClientTest(({ threadClien
           Assert.equal(packet.why.type, "breakpoint");
           Assert.equal(packet.why.actors[0], bpClient.actor);
           // Check that the breakpoint worked.
           Assert.equal(debuggee.a, 1);
           Assert.equal(debuggee.b, undefined);
 
           // Remove the breakpoint.
           bpClient.remove(function(response) {
-            threadClient.resume(resolve);
+            threadClient.resume().then(resolve);
           });
         });
 
         // Continue until the breakpoint is hit.
         threadClient.resume();
       });
     });
 
--- a/devtools/server/tests/unit/test_breakpoint-08.js
+++ b/devtools/server/tests/unit/test_breakpoint-08.js
@@ -33,17 +33,17 @@ add_task(threadClientTest(({ threadClien
         Assert.equal(packet.why.type, "breakpoint");
         Assert.equal(packet.why.actors[0], response.bpClient.actor);
         // Check that the breakpoint worked.
         Assert.equal(debuggee.a, 1);
         Assert.equal(debuggee.b, undefined);
 
         // Remove the breakpoint.
         response.bpClient.remove(function(response) {
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
     });
 
     /* eslint-disable */
--- a/devtools/server/tests/unit/test_breakpoint-09.js
+++ b/devtools/server/tests/unit/test_breakpoint-09.js
@@ -29,17 +29,17 @@ add_task(threadClientTest(({ threadClien
         Assert.equal(debuggee.a, undefined);
 
         // Remove the breakpoint.
         threadClient.removeBreakpoint(location);
         done = true;
         threadClient.addOneTimeListener("paused",
                                         function(event, packet) {
               // The breakpoint should not be hit again.
-                                          threadClient.resume(function() {
+                                          threadClient.resume().then(function() {
                                             Assert.ok(false);
                                           });
                                         });
         threadClient.resume();
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
--- a/devtools/server/tests/unit/test_breakpoint-10.js
+++ b/devtools/server/tests/unit/test_breakpoint-10.js
@@ -46,17 +46,17 @@ add_task(threadClientTest(({ threadClien
           Assert.equal(packet.type, "paused");
           Assert.equal(packet.why.type, "breakpoint");
           // Check that the breakpoint worked.
           Assert.equal(debuggee.i, 1);
 
           // Remove the breakpoint.
           threadClient.removeBreakpoint(location2);
 
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
 
         // Continue until the breakpoint is hit again.
         threadClient.resume();
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
--- a/devtools/server/tests/unit/test_breakpoint-11.js
+++ b/devtools/server/tests/unit/test_breakpoint-11.js
@@ -48,17 +48,17 @@ add_task(threadClientTest(({ threadClien
           Assert.equal(packet.why.type, "breakpoint");
           // Check that the breakpoint worked.
           Assert.equal(debuggee.a.b, 1);
           Assert.equal(debuggee.res, undefined);
 
           // Remove the breakpoint.
           threadClient.removeBreakpoint(location2);
 
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
 
         // Continue until the breakpoint is hit again.
         threadClient.resume();
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
--- a/devtools/server/tests/unit/test_breakpoint-12.js
+++ b/devtools/server/tests/unit/test_breakpoint-12.js
@@ -72,17 +72,17 @@ add_task(threadClientTest(({ threadClien
           // Check that the breakpoint worked.
           Assert.equal(debuggee.a, 1);
           Assert.equal(debuggee.b, undefined);
 
           threadClient.addOneTimeListener("paused", function(event, packet) {
             // We don't expect any more pauses after the breakpoint was hit once.
             Assert.ok(false);
           });
-          threadClient.resume(function() {
+          threadClient.resume().then(function() {
             // Give any remaining breakpoints a chance to trigger.
             do_timeout(1000, resolve);
           });
         });
         // Continue until the breakpoint is hit.
         threadClient.resume();
       });
     }
--- a/devtools/server/tests/unit/test_breakpoint-13.js
+++ b/devtools/server/tests/unit/test_breakpoint-13.js
@@ -65,17 +65,17 @@ add_task(threadClientTest(({ threadClien
       }
 
       // Remove the breakpoint and finish.
       const waiter = waitForPause(threadClient);
       threadClient.stepIn();
       await waiter;
       threadClient.removeBreakpoint(location);
 
-      threadClient.resume(resolve);
+      threadClient.resume().then(resolve);
     });
 
     /* eslint-disable */
     Cu.evalInSandbox("var line0 = Error().lineNumber;\n" +
                      "function foo() {\n" + // line0 + 1
                      "  this.a = 1;\n" +    // line0 + 2 <-- Breakpoint is set here.
                      "}\n" +                // line0 + 3
                      "debugger;\n" +        // line0 + 4
--- a/devtools/server/tests/unit/test_breakpoint-14.js
+++ b/devtools/server/tests/unit/test_breakpoint-14.js
@@ -62,17 +62,17 @@ add_task(threadClientTest(({ threadClien
         callback(packet);
       }
 
       // Remove the breakpoint and finish.
       const waiter = waitForPause(threadClient);
       threadClient.stepOver();
       await waiter;
       threadClient.removeBreakpoint(location);
-      threadClient.resume(resolve);
+      threadClient.resume().then(resolve);
     });
 
     /* eslint-disable */
     Cu.evalInSandbox("var line0 = Error().lineNumber;\n" +
                      "function foo() {\n" + // line0 + 1
                      "  this.a = 1;\n" +    // line0 + 2 <-- Breakpoint is set here.
                      "}\n" +                // line0 + 3
                      "debugger;\n" +        // line0 + 4
--- a/devtools/server/tests/unit/test_breakpoint-16.js
+++ b/devtools/server/tests/unit/test_breakpoint-16.js
@@ -34,17 +34,17 @@ add_task(threadClientTest(({ threadClien
 
         Assert.equal(debuggee.acc, timesBreakpointHit);
         Assert.equal(packet.frame.environment.bindings.variables.i.value,
                      timesBreakpointHit);
 
         if (++timesBreakpointHit === 3) {
           threadClient.removeListener("paused", onPaused);
           threadClient.removeBreakpoint(location);
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         } else {
           threadClient.resume();
         }
       });
 
       // Continue until the breakpoint is hit.
       threadClient.resume();
     });
--- a/devtools/server/tests/unit/test_breakpoint-17.js
+++ b/devtools/server/tests/unit/test_breakpoint-17.js
@@ -98,12 +98,12 @@ function test_remove_one(first, second, 
 
           resolve();
           return;
         }
 
         Assert.ok(false, "Should never get here");
       });
 
-      threadClient.resume(() => debuggee.foo());
+      threadClient.resume().then(() => debuggee.foo());
     });
   });
 }
--- a/devtools/server/tests/unit/test_conditional_breakpoint-01.js
+++ b/devtools/server/tests/unit/test_conditional_breakpoint-01.js
@@ -42,17 +42,17 @@ function test_simple_breakpoint() {
 
       // Check the return value.
       Assert.equal(packet.why.type, "breakpoint");
       Assert.equal(packet.frame.where.line, 3);
 
       // Remove the breakpoint.
       gThreadClient.removeBreakpoint(location);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
 
     // Continue until the breakpoint is hit.
     gThreadClient.resume();
   });
 
--- a/devtools/server/tests/unit/test_conditional_breakpoint-02.js
+++ b/devtools/server/tests/unit/test_conditional_breakpoint-02.js
@@ -39,17 +39,17 @@ function test_simple_breakpoint() {
     gThreadClient.addOneTimeListener("paused", function(event, packet) {
       // Check the return value.
       Assert.equal(packet.why.type, "breakpoint");
       Assert.equal(packet.frame.where.line, 4);
 
       // Remove the breakpoint.
       gThreadClient.removeBreakpoint(location2);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
 
     // Continue until the breakpoint is hit.
     gThreadClient.resume();
   });
 
--- a/devtools/server/tests/unit/test_conditional_breakpoint-03.js
+++ b/devtools/server/tests/unit/test_conditional_breakpoint-03.js
@@ -37,17 +37,17 @@ function test_simple_breakpoint() {
     gThreadClient.addOneTimeListener("paused", function(event, packet) {
       // Check the return value.
       Assert.equal(packet.why.type, "breakpointConditionThrown");
       Assert.equal(packet.frame.where.line, 3);
 
       // Remove the breakpoint.
       gThreadClient.removeBreakpoint(location);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
 
     // Continue until the breakpoint is hit.
     gThreadClient.resume();
   });
 
--- a/devtools/server/tests/unit/test_frameactor-01.js
+++ b/devtools/server/tests/unit/test_frameactor-01.js
@@ -29,17 +29,17 @@ function run_test() {
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
     Assert.ok(!!packet.frame);
     Assert.ok(!!packet.frame.actor);
     Assert.equal(packet.frame.displayName, "stopMe");
-    gThreadClient.resume(function() {
+    gThreadClient.resume().then(function() {
       finishClient(gClient);
     });
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe() {
       debugger;
     }
--- a/devtools/server/tests/unit/test_frameactor-02.js
+++ b/devtools/server/tests/unit/test_frameactor-02.js
@@ -29,17 +29,17 @@ function run_test() {
   });
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet1) {
     gThreadClient.addOneTimeListener("paused", function(event, packet2) {
       Assert.equal(packet1.frame.actor, packet2.frame.actor);
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
     gThreadClient.resume();
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe() {
--- a/devtools/server/tests/unit/test_frameactor-03.js
+++ b/devtools/server/tests/unit/test_frameactor-03.js
@@ -31,17 +31,17 @@ function run_test() {
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet1) {
     gThreadClient.addOneTimeListener("paused", function(event, packet2) {
       const poppedFrames = packet2.poppedFrames;
       Assert.equal(typeof (poppedFrames), typeof ([]));
       Assert.ok(poppedFrames.includes(packet1.frame.actor));
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
     gThreadClient.resume();
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe() {
--- a/devtools/server/tests/unit/test_frameactor-04.js
+++ b/devtools/server/tests/unit/test_frameactor-04.js
@@ -37,28 +37,28 @@ var frameFixtures = [
 
   // Anonymous function call in our eval...
   { type: "call", displayName: undefined },
 
   // The eval itself.
   { type: "eval", displayName: "(eval)" },
 ];
 
-function test_frame_packet() {
-  gThreadClient.getFrames(0, 1000, function(response) {
-    for (let i = 0; i < response.frames.length; i++) {
-      const expected = frameFixtures[i];
-      const actual = response.frames[i];
+async function test_frame_packet() {
+  const response = await gThreadClient.getFrames(0, 1000);
+  for (let i = 0; i < response.frames.length; i++) {
+    const expected = frameFixtures[i];
+    const actual = response.frames[i];
 
-      Assert.equal(expected.displayname, actual.displayname, "Frame displayname");
-      Assert.equal(expected.type, actual.type, "Frame displayname");
-    }
+    Assert.equal(expected.displayname, actual.displayname, "Frame displayname");
+    Assert.equal(expected.type, actual.type, "Frame displayname");
+  }
 
-    gThreadClient.resume(() => finishClient(gClient));
-  });
+  await gThreadClient.resume();
+  await finishClient(gClient);
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
     test_frame_packet();
   });
 
   gDebuggee.eval("(" + function() {
--- a/devtools/server/tests/unit/test_frameactor-05.js
+++ b/devtools/server/tests/unit/test_frameactor-05.js
@@ -28,31 +28,31 @@ function run_test() {
                              test_pause_frame();
                            });
   });
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getFrames(0, null, function(frameResponse) {
+    gThreadClient.getFrames(0, null).then(function(frameResponse) {
       Assert.equal(frameResponse.frames.length, 5);
       // Now wait for the next pause, after which the three
       // youngest actors should be popped..
       const expectPopped = frameResponse.frames.slice(0, 3).map(frame => frame.actor);
       expectPopped.sort();
 
       gThreadClient.addOneTimeListener("paused", function(event, pausePacket) {
         const popped = pausePacket.poppedFrames.sort();
         Assert.equal(popped.length, 3);
         for (let i = 0; i < 3; i++) {
           Assert.equal(expectPopped[i], popped[i]);
         }
 
-        gThreadClient.resume(() => finishClient(gClient));
+        gThreadClient.resume().then(() => finishClient(gClient));
       });
       gThreadClient.resume();
     });
   });
 
   gDebuggee.eval("(" + function() {
     function depth3() {
       debugger;
--- a/devtools/server/tests/unit/test_frameactor_wasm-01.js
+++ b/devtools/server/tests/unit/test_frameactor_wasm-01.js
@@ -39,17 +39,17 @@ function run_test() {
         });
       });
   });
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getFrames(0, null, async function(frameResponse) {
+    gThreadClient.getFrames(0, null).then(async function(frameResponse) {
       Assert.equal(frameResponse.frames.length, 4);
 
       const wasmFrame = frameResponse.frames[1];
       Assert.equal(wasmFrame.type, "wasmcall");
       Assert.equal(wasmFrame.this, undefined);
 
       const location = wasmFrame.where;
       const source = await getSourceById(gThreadClient, location.actor);
--- a/devtools/server/tests/unit/test_framearguments-01.js
+++ b/devtools/server/tests/unit/test_framearguments-01.js
@@ -37,17 +37,17 @@ function test_pause_frame() {
     Assert.equal(args[1], true);
     Assert.equal(args[2], "nasu");
     Assert.equal(args[3].type, "null");
     Assert.equal(args[4].type, "undefined");
     Assert.equal(args[5].type, "object");
     Assert.equal(args[5].class, "Object");
     Assert.ok(!!args[5].actor);
 
-    gThreadClient.resume(function() {
+    gThreadClient.resume().then(function() {
       finishClient(gClient);
     });
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe(number, bool, string, null_, undef, object) {
       debugger;
     }
--- a/devtools/server/tests/unit/test_framebindings-01.js
+++ b/devtools/server/tests/unit/test_framebindings-01.js
@@ -61,17 +61,17 @@ function test_pause_frame() {
       Assert.equal(response.ownProperties.a.value, "a");
 
       Assert.equal(response.ownProperties.b.configurable, true);
       Assert.equal(response.ownProperties.b.enumerable, true);
       Assert.equal(response.ownProperties.b.writable, true);
       Assert.equal(response.ownProperties.b.value.type, "undefined");
       Assert.equal(false, "class" in response.ownProperties.b.value);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
     function stopMe(number, bool, string, null_, undef, object) {
--- a/devtools/server/tests/unit/test_framebindings-02.js
+++ b/devtools/server/tests/unit/test_framebindings-02.js
@@ -47,17 +47,17 @@ function test_pause_frame() {
     parentEnv = parentEnv.parent.parent;
     Assert.notEqual(parentEnv, undefined);
     const objClient = gThreadClient.pauseGrip(parentEnv.object);
     objClient.getPrototypeAndProperties(function(response) {
       Assert.equal(response.ownProperties.Object.value.type, "object");
       Assert.equal(response.ownProperties.Object.value.class, "Function");
       Assert.ok(!!response.ownProperties.Object.value.actor);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
     function stopMe(number, bool, string, null_, undef, object) {
--- a/devtools/server/tests/unit/test_framebindings-03.js
+++ b/devtools/server/tests/unit/test_framebindings-03.js
@@ -52,17 +52,17 @@ function test_pause_frame() {
 
     const objClient = gThreadClient.pauseGrip(env.object);
     objClient.getPrototypeAndProperties(function(response) {
       Assert.equal(response.ownProperties.PI.value, Math.PI);
       Assert.equal(response.ownProperties.cos.value.type, "object");
       Assert.equal(response.ownProperties.cos.value.class, "Function");
       Assert.ok(!!response.ownProperties.cos.value.actor);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
     function stopMe(number) {
--- a/devtools/server/tests/unit/test_framebindings-04.js
+++ b/devtools/server/tests/unit/test_framebindings-04.js
@@ -63,17 +63,17 @@ function test_pause_frame() {
         Assert.equal(args.length, 1);
         Assert.equal(args[0].number.value, 10);
         Assert.equal(vars.r.value, 10);
         Assert.equal(vars.a.value, Math.PI * 100);
         Assert.equal(vars.arguments.value.class, "Arguments");
         Assert.ok(!!vars.arguments.value.actor);
         Assert.equal(vars.foo.value, 2 * Math.PI);
 
-        gThreadClient.resume(function() {
+        gThreadClient.resume().then(function() {
           finishClient(gClient);
         });
       });
     });
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
--- a/devtools/server/tests/unit/test_framebindings-05.js
+++ b/devtools/server/tests/unit/test_framebindings-05.js
@@ -51,17 +51,17 @@ function test_pause_frame() {
       const parentClient = gThreadClient.pauseGrip(parentEnv.object);
       parentClient.getPrototypeAndProperties(function(response) {
         Assert.equal(response.ownProperties.a.value, Math.PI * 100);
         Assert.equal(response.ownProperties.r.value, 10);
         Assert.equal(response.ownProperties.Object.value.type, "object");
         Assert.equal(response.ownProperties.Object.value.class, "Function");
         Assert.ok(!!response.ownProperties.Object.value.actor);
 
-        gThreadClient.resume(function() {
+        gThreadClient.resume().then(function() {
           finishClient(gClient);
         });
       });
     });
   });
 
   gDebuggee.eval("var a, r = 10;\n" +
                  "with (Math) {\n" +
--- a/devtools/server/tests/unit/test_framebindings-06.js
+++ b/devtools/server/tests/unit/test_framebindings-06.js
@@ -43,17 +43,17 @@ function test_banana_environment() {
       equal(parent.function.name, "banana2");
       parent = parent.parent;
       equal(parent.type, "block");
       ok("banana2" in parent.bindings.variables);
       parent = parent.parent;
       equal(parent.type, "function");
       equal(parent.function.name, "banana");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
 
   gDebuggee.eval("function banana(x) {\n" +
                  "  return function banana2(y) {\n" +
                  "    return function banana3(z) {\n" +
                  "      debugger;\n" +
--- a/devtools/server/tests/unit/test_framebindings-07.js
+++ b/devtools/server/tests/unit/test_framebindings-07.js
@@ -48,17 +48,17 @@ function test_banana_environment() {
 
       const parentClient = new EnvironmentClient(gThreadClient, parent);
       parentClient.getBindings(response => {
         Assert.equal(response.bindings.variables.banana3.value.class, "Function");
 
         const grandpaClient = new EnvironmentClient(gThreadClient, grandpa);
         grandpaClient.getBindings(response => {
           Assert.equal(response.bindings.arguments[0].y.value, "y");
-          gThreadClient.resume(() => finishClient(gClient));
+          gThreadClient.resume().then(() => finishClient(gClient));
         });
       });
     });
   });
 
   gDebuggee.eval("function banana(x) {\n" +
                  "  return function banana2(y) {\n" +
                  "    return function banana3(z) {\n" +
--- a/devtools/server/tests/unit/test_functiongrips-01.js
+++ b/devtools/server/tests/unit/test_functiongrips-01.js
@@ -37,17 +37,17 @@ function test_named_function() {
     Assert.equal(args[0].name, "stopMe");
     Assert.equal(args[0].displayName, "stopMe");
 
     const objClient = gThreadClient.pauseGrip(args[0]);
     objClient.getParameterNames(function(response) {
       Assert.equal(response.parameterNames.length, 1);
       Assert.equal(response.parameterNames[0], "arg1");
 
-      gThreadClient.resume(test_inferred_name_function);
+      gThreadClient.resume().then(test_inferred_name_function);
     });
   });
 
   gDebuggee.eval("stopMe(stopMe)");
 }
 
 function test_inferred_name_function() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
@@ -60,17 +60,17 @@ function test_inferred_name_function() {
 
     const objClient = gThreadClient.pauseGrip(args[0]);
     objClient.getParameterNames(function(response) {
       Assert.equal(response.parameterNames.length, 3);
       Assert.equal(response.parameterNames[0], "foo");
       Assert.equal(response.parameterNames[1], "bar");
       Assert.equal(response.parameterNames[2], "baz");
 
-      gThreadClient.resume(test_anonymous_function);
+      gThreadClient.resume().then(test_anonymous_function);
     });
   });
 
   gDebuggee.eval("var o = { m: function(foo, bar, baz) { } }; stopMe(o.m)");
 }
 
 function test_anonymous_function() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
@@ -83,17 +83,17 @@ function test_anonymous_function() {
 
     const objClient = gThreadClient.pauseGrip(args[0]);
     objClient.getParameterNames(function(response) {
       Assert.equal(response.parameterNames.length, 3);
       Assert.equal(response.parameterNames[0], "foo");
       Assert.equal(response.parameterNames[1], "bar");
       Assert.equal(response.parameterNames[2], "baz");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   gDebuggee.eval("stopMe(function(foo, bar, baz) { })");
 }
 
--- a/devtools/server/tests/unit/test_interrupt.js
+++ b/devtools/server/tests/unit/test_interrupt.js
@@ -1,17 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable no-shadow */
 
 "use strict";
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client, targetFront }) => {
-  return new Promise(resolve => {
-    threadClient.interrupt(function(response) {
-      Assert.equal(threadClient.paused, true);
-      threadClient.resume(function() {
-        Assert.equal(threadClient.paused, false);
-        resolve();
-      });
-    });
-  });
+  await threadClient.interrupt();
+  Assert.equal(threadClient.paused, true);
+  await threadClient.resume();
+  Assert.equal(threadClient.paused, false);
 }));
--- a/devtools/server/tests/unit/test_listsources-01.js
+++ b/devtools/server/tests/unit/test_listsources-01.js
@@ -32,26 +32,26 @@ function run_test() {
                              test_simple_listsources();
                            });
   });
   do_test_pending();
 }
 
 function test_simple_listsources() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getSources(function(response) {
+    gThreadClient.getSources().then(function(response) {
       Assert.ok(response.sources.some(function(s) {
         return s.url && s.url.match(/test_listsources-01.js/);
       }));
 
       Assert.ok(gNumTimesSourcesSent <= 1,
                 "Should only send one sources request at most, even though we"
                 + " might have had to send one to determine feature support.");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   /* eslint-disable */
   Cu.evalInSandbox("var line0 = Error().lineNumber;\n" +
                   "debugger;\n" +   // line0 + 1
--- a/devtools/server/tests/unit/test_listsources-02.js
+++ b/devtools/server/tests/unit/test_listsources-02.js
@@ -30,17 +30,17 @@ function run_test() {
                              gThreadClient = threadClient;
                              test_listing_zero_sources();
                            });
   });
   do_test_pending();
 }
 
 function test_listing_zero_sources() {
-  gThreadClient.getSources(function(packet) {
+  gThreadClient.getSources().then(function(packet) {
     Assert.ok(!packet.error);
     Assert.ok(!!packet.sources);
     Assert.equal(packet.sources.length, 0);
 
     Assert.ok(gNumTimesSourcesSent <= 1,
               "Should only send one sources request at most, even though we"
               + " might have had to send one to determine feature support.");
 
--- a/devtools/server/tests/unit/test_listsources-03.js
+++ b/devtools/server/tests/unit/test_listsources-03.js
@@ -26,26 +26,26 @@ function run_test() {
                              test_simple_listsources();
                            });
   });
   do_test_pending();
 }
 
 function test_simple_listsources() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getSources(function(response) {
+    gThreadClient.getSources().then(function(response) {
       Assert.ok(
         !response.error,
         "There shouldn't be an error fetching large amounts of sources.");
 
       Assert.ok(response.sources.some(function(s) {
         return s.url.match(/foo-999.js$/);
       }));
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   for (let i = 0; i < 1000; i++) {
     Cu.evalInSandbox("function foo###() {return ###;}".replace(/###/g, i),
                      gDebuggee,
--- a/devtools/server/tests/unit/test_longstringgrips-01.js
+++ b/devtools/server/tests/unit/test_longstringgrips-01.js
@@ -56,23 +56,23 @@ function test_longstring_grip() {
       Assert.equal(grip.initial,
                    longString.substr(0, DebuggerServer.LONG_STRING_INITIAL_LENGTH));
 
       const longStringFront = createLongStringFront(gClient, grip);
       longStringFront.substring(22, 28).then(function(response) {
         try {
           Assert.equal(response, "monkey");
         } finally {
-          gThreadClient.resume(function() {
+          gThreadClient.resume().then(function() {
             finishClient(gClient);
           });
         }
       });
     } catch (error) {
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
         do_throw(error);
       });
     }
   });
 
   gDebuggee.eval('stopMe("' + longString + '")');
 }
--- a/devtools/server/tests/unit/test_nesting-03.js
+++ b/devtools/server/tests/unit/test_nesting-03.js
@@ -31,24 +31,28 @@ function start_second_connection() {
     attachTestThread(gClient2, "test-nesting1",
                      function(response, targetFront, threadClient) {
                        gThreadClient2 = threadClient;
                        test_nesting();
                      });
   });
 }
 
-function test_nesting() {
-  gThreadClient1.resume(response => {
-    Assert.equal(response.error, "wrongOrder");
-    gThreadClient2.resume(response => {
-      Assert.ok(!response.error);
-      Assert.equal(response.from, gThreadClient2.actor);
+async function test_nesting() {
+  try {
+    await gThreadClient1.resume();
+  } catch (e) {
+    Assert.equal(e.error, "wrongOrder");
+  }
+  try {
+    await gThreadClient2.resume();
+  } catch (e) {
+    Assert.ok(!e.error);
+    Assert.equal(e.from, gThreadClient2.actor);
+  }
 
-      gThreadClient1.resume(response => {
-        Assert.ok(!response.error);
-        Assert.equal(response.from, gThreadClient1.actor);
+  gThreadClient1.resume().then(response => {
+    Assert.ok(!response.error);
+    Assert.equal(response.from, gThreadClient1.actor);
 
-        gClient1.close(() => finishClient(gClient2));
-      });
-    });
+    gClient1.close(() => finishClient(gClient2));
   });
 }
--- a/devtools/server/tests/unit/test_objectgrips-01.js
+++ b/devtools/server/tests/unit/test_objectgrips-01.js
@@ -17,17 +17,17 @@ add_task(threadClientTest(async ({ threa
 
       const objClient = threadClient.pauseGrip(args[0]);
       objClient.getOwnPropertyNames(function(response) {
         Assert.equal(response.ownPropertyNames.length, 3);
         Assert.equal(response.ownPropertyNames[0], "a");
         Assert.equal(response.ownPropertyNames[1], "b");
         Assert.equal(response.ownPropertyNames[2], "c");
 
-        threadClient.resume(resolve);
+        threadClient.resume().then(resolve);
       });
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     debuggee.eval("stopMe({ a: 1, b: true, c: 'foo' })");
   });
--- a/devtools/server/tests/unit/test_objectgrips-02.js
+++ b/devtools/server/tests/unit/test_objectgrips-02.js
@@ -21,17 +21,17 @@ add_task(threadClientTest(async ({ threa
         Assert.ok(response.prototype != undefined);
 
         const protoClient = threadClient.pauseGrip(response.prototype);
         protoClient.getOwnPropertyNames(function(response) {
           Assert.equal(response.ownPropertyNames.length, 2);
           Assert.equal(response.ownPropertyNames[0], "b");
           Assert.equal(response.ownPropertyNames[1], "c");
 
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
       });
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     debuggee.eval(function Constr() {
--- a/devtools/server/tests/unit/test_objectgrips-03.js
+++ b/devtools/server/tests/unit/test_objectgrips-03.js
@@ -31,17 +31,17 @@ add_task(threadClientTest(async ({ threa
 
           objClient.getProperty("a", function(response) {
             Assert.equal(response.descriptor.configurable, true);
             Assert.equal(response.descriptor.enumerable, true);
             Assert.equal(response.descriptor.get.type, "object");
             Assert.equal(response.descriptor.get.class, "Function");
             Assert.equal(response.descriptor.set.type, "undefined");
 
-            threadClient.resume(resolve);
+            threadClient.resume().then(resolve);
           });
         });
       });
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
--- a/devtools/server/tests/unit/test_objectgrips-04.js
+++ b/devtools/server/tests/unit/test_objectgrips-04.js
@@ -35,17 +35,17 @@ add_task(threadClientTest(async ({ threa
         Assert.equal(response.ownProperties.a.set.type, "undefined");
 
         Assert.ok(response.prototype != undefined);
 
         const protoClient = threadClient.pauseGrip(response.prototype);
         protoClient.getOwnPropertyNames(function(response) {
           Assert.ok(response.ownPropertyNames.toString != undefined);
 
-          threadClient.resume(resolve);
+          threadClient.resume().then(resolve);
         });
       });
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     debuggee.eval("stopMe({ x: 10, y: 'kaiju', get a() { return 42; } })");
--- a/devtools/server/tests/unit/test_objectgrips-05.js
+++ b/devtools/server/tests/unit/test_objectgrips-05.js
@@ -23,17 +23,17 @@ add_task(threadClientTest(async ({ threa
       Assert.ok(obj1Client.isFrozen);
 
       const obj2 = packet.frame.arguments[1];
       Assert.ok(!obj2.frozen);
 
       const obj2Client = threadClient.pauseGrip(obj2);
       Assert.ok(!obj2Client.isFrozen);
 
-      threadClient.resume(resolve);
+      threadClient.resume().then(resolve);
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     /* eslint-disable no-undef */
     debuggee.eval("(" + function() {
       const obj1 = {};
--- a/devtools/server/tests/unit/test_objectgrips-06.js
+++ b/devtools/server/tests/unit/test_objectgrips-06.js
@@ -23,17 +23,17 @@ add_task(threadClientTest(async ({ threa
       Assert.ok(obj1Client.isSealed);
 
       const obj2 = packet.frame.arguments[1];
       Assert.ok(!obj2.sealed);
 
       const obj2Client = threadClient.pauseGrip(obj2);
       Assert.ok(!obj2Client.isSealed);
 
-      threadClient.resume(resolve);
+      threadClient.resume().then(resolve);
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     /* eslint-disable no-undef */
     debuggee.eval("(" + function() {
       const obj1 = {};
--- a/devtools/server/tests/unit/test_objectgrips-07.js
+++ b/devtools/server/tests/unit/test_objectgrips-07.js
@@ -27,17 +27,17 @@ add_task(threadClientTest(async ({ threa
       Assert.ok(!sClient.isExtensible);
 
       Assert.ok(!ne.extensible);
       Assert.ok(!neClient.isExtensible);
 
       Assert.ok(e.extensible);
       Assert.ok(eClient.isExtensible);
 
-      threadClient.resume(resolve);
+      threadClient.resume().then(resolve);
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     /* eslint-disable no-undef */
     debuggee.eval("(" + function() {
       const f = {};
--- a/devtools/server/tests/unit/test_objectgrips-08.js
+++ b/devtools/server/tests/unit/test_objectgrips-08.js
@@ -26,17 +26,17 @@ add_task(threadClientTest(async ({ threa
 
         if (bigIntEnabled) {
           const {e, f, g} = response.ownProperties;
           testPropertyType(e, "BigInt");
           testPropertyType(f, "BigInt");
           testPropertyType(g, "BigInt");
         }
 
-        threadClient.resume(resolve);
+        threadClient.resume().then(resolve);
       });
     });
 
     debuggee.eval(function stopMe(arg1) {
       debugger;
     }.toString());
     debuggee.eval(`stopMe({
       a: Infinity,
--- a/devtools/server/tests/unit/test_objectgrips-10.js
+++ b/devtools/server/tests/unit/test_objectgrips-10.js
@@ -52,17 +52,17 @@ function test_object_grip() {
         Assert.equal(response.scope.bindings.arguments[0].name.value, "Bob");
 
         getAgeClient.getScope(response => {
           Assert.equal(response.scope.bindings.arguments[1].age.value, 58);
 
           getFooClient.getScope(response => {
             Assert.equal(response.scope.bindings.variables.foo.value, 10);
 
-            gThreadClient.resume(() => finishClient(gClient));
+            gThreadClient.resume().then(() => finishClient(gClient));
           });
         });
       });
     });
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
--- a/devtools/server/tests/unit/test_objectgrips-11.js
+++ b/devtools/server/tests/unit/test_objectgrips-11.js
@@ -42,17 +42,17 @@ function test_object_grip() {
       const opn = response.ownPropertyNames;
       Assert.equal(opn.length, 4);
       opn.sort();
       Assert.equal(opn[0], "columnNumber");
       Assert.equal(opn[1], "fileName");
       Assert.equal(opn[2], "lineNumber");
       Assert.equal(opn[3], "message");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   gDebuggee.eval("stopMe(new TypeError('error message text'))");
 }
 
--- a/devtools/server/tests/unit/test_objectgrips-12.js
+++ b/devtools/server/tests/unit/test_objectgrips-12.js
@@ -152,17 +152,17 @@ function test_display_string() {
 
     (function loop() {
       const objClient = gThreadClient.pauseGrip(args.pop());
       objClient.getDisplayString(function({ displayString }) {
         Assert.equal(displayString, testCases.pop().output);
         if (args.length) {
           loop();
         } else {
-          gThreadClient.resume(function() {
+          gThreadClient.resume().then(function() {
             finishClient(gClient);
           });
         }
       });
     })();
   });
 
   const inputs = testCases.map(({ input }) => input).join(",");
--- a/devtools/server/tests/unit/test_objectgrips-13.js
+++ b/devtools/server/tests/unit/test_objectgrips-13.js
@@ -57,11 +57,11 @@ function test_definition_site(func, obj)
     test_bad_definition_site(obj);
   });
 }
 
 function test_bad_definition_site(obj) {
   try {
     obj._client.request("definitionSite", () => Assert.ok(false));
   } catch (e) {
-    gThreadClient.resume(() => finishClient(gClient));
+    gThreadClient.resume().then(() => finishClient(gClient));
   }
 }
--- a/devtools/server/tests/unit/test_pause_exceptions-01.js
+++ b/devtools/server/tests/unit/test_pause_exceptions-01.js
@@ -33,17 +33,17 @@ function run_test() {
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
     gThreadClient.addOneTimeListener("paused", function(event, packet) {
       Assert.equal(packet.why.type, "exception");
       Assert.equal(packet.why.exception, 42);
-      gThreadClient.resume(() => finishClient(gClient));
+      gThreadClient.resume().then(() => finishClient(gClient));
     });
 
     gThreadClient.pauseOnExceptions(true, false);
     gThreadClient.resume();
   });
 
   /* eslint-disable */
   gDebuggee.eval("(" + function () {
--- a/devtools/server/tests/unit/test_pause_exceptions-02.js
+++ b/devtools/server/tests/unit/test_pause_exceptions-02.js
@@ -28,21 +28,21 @@ function run_test() {
                              gThreadClient = threadClient;
                              test_pause_frame();
                            });
   });
   do_test_pending();
 }
 
 function test_pause_frame() {
-  gThreadClient.pauseOnExceptions(true, false, function() {
+  gThreadClient.pauseOnExceptions(true, false).then(function() {
     gThreadClient.addOneTimeListener("paused", function(event, packet) {
       Assert.equal(packet.why.type, "exception");
       Assert.equal(packet.why.exception, 42);
-      gThreadClient.resume(() => finishClient(gClient));
+      gThreadClient.resume().then(() => finishClient(gClient));
     });
 
     /* eslint-disable */
     gDebuggee.eval("(" + function () {   // 1
       function stopMe() {                // 2
         throw 42;                        // 3
       }                                  // 4
       try {                              // 5
--- a/devtools/server/tests/unit/test_pauselifetime-01.js
+++ b/devtools/server/tests/unit/test_pauselifetime-01.js
@@ -34,17 +34,17 @@ function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
     const pauseActor = packet.actor;
 
     // Make a bogus request to the pause-lifetime actor.  Should get
     // unrecognized-packet-type (and not no-such-actor).
     gClient.request({ to: pauseActor, type: "bogusRequest" }, function(response) {
       Assert.equal(response.error, "unrecognizedPacketType");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         // Now that we've resumed, should get no-such-actor for the
         // same request.
         gClient.request({ to: pauseActor, type: "bogusRequest" }, function(response) {
           Assert.equal(response.error, "noSuchActor");
           finishClient(gClient);
         });
       });
     });
--- a/devtools/server/tests/unit/test_pauselifetime-02.js
+++ b/devtools/server/tests/unit/test_pauselifetime-02.js
@@ -37,17 +37,17 @@ function test_pause_frame() {
     Assert.equal(args[0].class, "Object");
     Assert.ok(!!objActor);
 
     // Make a bogus request to the grip actor.  Should get
     // unrecognized-packet-type (and not no-such-actor).
     gClient.request({ to: objActor, type: "bogusRequest" }, function(response) {
       Assert.equal(response.error, "unrecognizedPacketType");
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         // Now that we've resumed, should get no-such-actor for the
         // same request.
         gClient.request({ to: objActor, type: "bogusRequest" }, function(response) {
           Assert.equal(response.error, "noSuchActor");
           finishClient(gClient);
         });
       });
     });
--- a/devtools/server/tests/unit/test_pauselifetime-03.js
+++ b/devtools/server/tests/unit/test_pauselifetime-03.js
@@ -41,17 +41,17 @@ function test_pause_frame() {
     Assert.ok(objClient.valid);
 
     // Make a bogus request to the grip actor.  Should get
     // unrecognized-packet-type (and not no-such-actor).
     gClient.request({ to: objActor, type: "bogusRequest" }, function(response) {
       Assert.equal(response.error, "unrecognizedPacketType");
       Assert.ok(objClient.valid);
 
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         // Now that we've resumed, should get no-such-actor for the
         // same request.
         gClient.request({ to: objActor, type: "bogusRequest" }, function(response) {
           Assert.ok(!objClient.valid);
           Assert.equal(response.error, "noSuchActor");
           finishClient(gClient);
         });
       });
--- a/devtools/server/tests/unit/test_pauselifetime-04.js
+++ b/devtools/server/tests/unit/test_pauselifetime-04.js
@@ -30,20 +30,20 @@ function run_test() {
   do_test_pending();
 }
 
 function test_pause_frame() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
     const args = packet.frame.arguments;
     const objActor1 = args[0].actor;
 
-    gThreadClient.getFrames(0, 1, function(response) {
+    gThreadClient.getFrames(0, 1).then(function(response) {
       const frame = response.frames[0];
       Assert.equal(objActor1, frame.arguments[0].actor);
-      gThreadClient.resume(function() {
+      gThreadClient.resume().then(function() {
         finishClient(gClient);
       });
     });
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe(obj) {
       debugger;
--- a/devtools/server/tests/unit/test_source-01.js
+++ b/devtools/server/tests/unit/test_source-01.js
@@ -38,17 +38,17 @@ function run_test() {
 
 const SOURCE_URL = "http://example.com/foobar.js";
 const SOURCE_CONTENT = "stopMe()";
 
 function test_source() {
   DebuggerServer.LONG_STRING_LENGTH = 200;
 
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getSources(function(response) {
+    gThreadClient.getSources().then(function(response) {
       Assert.ok(!!response);
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.url === SOURCE_URL;
       })[0];
 
       Assert.ok(!!source);
@@ -58,17 +58,17 @@ function test_source() {
         Assert.ok(!!response);
         Assert.ok(!!response.contentType);
         Assert.ok(response.contentType.includes("javascript"));
 
         Assert.ok(!!response.source);
         Assert.equal(SOURCE_CONTENT,
                      response.source);
 
-        gThreadClient.resume(function() {
+        gThreadClient.resume().then(function() {
           finishClient(gClient);
         });
       });
     });
   });
 
   Cu.evalInSandbox(
     SOURCE_CONTENT,
--- a/devtools/server/tests/unit/test_source-02.js
+++ b/devtools/server/tests/unit/test_source-02.js
@@ -43,17 +43,17 @@ const SOURCE_CONTENT = `
     debugger;
   }
 `;
 
 function test_source() {
   DebuggerServer.LONG_STRING_LENGTH = 200;
 
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getSources(async function(response) {
+    gThreadClient.getSources().then(async function(response) {
       Assert.ok(!!response);
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.url === SOURCE_URL;
       })[0];
 
       Assert.ok(!!source);
--- a/devtools/server/tests/unit/test_stepping-05.js
+++ b/devtools/server/tests/unit/test_stepping-05.js
@@ -36,33 +36,32 @@ add_task(threadClientTest(async ({ threa
 
   const step3 = await stepIn(client, threadClient);
   equal(step3.type, "paused");
   equal(step3.frame.where.line, 4);
   equal(step3.why.type, "resumeLimit");
   equal(debuggee.a, 1);
   equal(debuggee.b, 2);
 
-  await new Promise(resolve => {
-    threadClient.stepIn(() => {
-      threadClient.addOneTimeListener("paused", (event, packet) => {
-        equal(packet.type, "paused");
-        // Before fixing bug 785689, the type was resumeLimit.
-        equal(packet.why.type, "debuggerStatement");
-        resolve();
-      });
-      debuggee.eval("debugger;");
+  await new Promise(async resolve => {
+    await threadClient.stepIn();
+    threadClient.addOneTimeListener("paused", (event, packet) => {
+      equal(packet.type, "paused");
+      // Before fixing bug 785689, the type was resumeLimit.
+      equal(packet.why.type, "debuggerStatement");
+      resolve();
     });
+    debuggee.eval("debugger;");
   });
 }));
 
 function evaluateTestCode(debuggee) {
   /* eslint-disable */
   Cu.evalInSandbox(
-    `                                   // 1                       
+    `                                   // 1
     debugger;                           // 2
     var a = 1;                          // 3
     var b = 2;`,                        // 4
     debuggee,
     "1.8",
     "test_stepping-05-test-code.js",
     1
   );
--- a/devtools/server/tests/unit/test_threadlifetime-01.js
+++ b/devtools/server/tests/unit/test_threadlifetime-01.js
@@ -40,17 +40,17 @@ function test_thread_lifetime() {
       Assert.equal(response.error, undefined);
       gThreadClient.addOneTimeListener("paused", function(event, packet) {
         // Verify that the promoted actor is returned again.
         Assert.equal(pauseGrip.actor, packet.frame.arguments[0].actor);
         // Now that we've resumed, should get unrecognizePacketType for the
         // promoted grip.
         gClient.request({to: pauseGrip.actor, type: "bogusRequest"}, function(response) {
           Assert.equal(response.error, "unrecognizedPacketType");
-          gThreadClient.resume(function() {
+          gThreadClient.resume().then(function() {
             finishClient(gClient);
           });
         });
       });
       gThreadClient.resume();
     });
   });
 
--- a/devtools/server/tests/unit/test_threadlifetime-02.js
+++ b/devtools/server/tests/unit/test_threadlifetime-02.js
@@ -41,17 +41,17 @@ function test_thread_lifetime() {
       gThreadClient.addOneTimeListener("paused", function(event, packet) {
         // Verify that the promoted actor is returned again.
         Assert.equal(pauseGrip.actor, packet.frame.arguments[0].actor);
         // Now that we've resumed, release the thread-lifetime grip.
         gClient.release(pauseGrip.actor, function(response) {
           gClient.request(
             {to: pauseGrip.actor, type: "bogusRequest"}, function(response) {
               Assert.equal(response.error, "noSuchActor");
-              gThreadClient.resume(function(response) {
+              gThreadClient.resume().then(function() {
                 finishClient(gClient);
               });
             });
         });
       });
       gThreadClient.resume();
     });
   });
--- a/devtools/server/tests/unit/test_threadlifetime-04.js
+++ b/devtools/server/tests/unit/test_threadlifetime-04.js
@@ -38,17 +38,17 @@ function test_thread_lifetime() {
     gClient.request({ to: pauseGrip.actor, type: "threadGrip" }, function(response) {
       // Successful promotion won't return an error.
       Assert.equal(response.error, undefined);
 
       const threadGrip1 = response.from;
 
       gClient.request({ to: pauseGrip.actor, type: "threadGrip" }, function(response) {
         Assert.equal(threadGrip1, response.from);
-        gThreadClient.resume(function() {
+        gThreadClient.resume().then(function() {
           finishClient(gClient);
         });
       });
     });
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe(arg1) {
--- a/devtools/server/tests/unit/test_wasm_source-01.js
+++ b/devtools/server/tests/unit/test_wasm_source-01.js
@@ -33,34 +33,33 @@ function run_test() {
 
     attachTestTabAndResume(
       gClient, "test-wasm-source",
       function(response, targetFront, threadClient) {
         gThreadClient = threadClient;
         gThreadClient.reconfigure({
           observeAsmJS: true,
           wasmBinarySource: true,
-        }, function(response) {
-          Assert.equal(!!response.error, false);
+        }).then(function() {
           test_source();
         });
       });
   });
   do_test_pending();
 }
 
 const EXPECTED_CONTENT = String.fromCharCode(
   0, 97, 115, 109, 1, 0, 0, 0, 1, 132, 128, 128, 128, 0, 1, 96, 0, 0, 3, 130,
   128, 128, 128, 0, 1, 0, 6, 129, 128, 128, 128, 0, 0, 7, 133, 128, 128, 128,
   0, 1, 1, 102, 0, 0, 10, 136, 128, 128, 128, 0, 1, 130, 128, 128, 128, 0, 0,
   11);
 
 function test_source() {
   gThreadClient.addOneTimeListener("paused", function(event, packet) {
-    gThreadClient.getSources(function(response) {
+    gThreadClient.getSources().then(function(response) {
       Assert.ok(!!response);
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.introductionType === "wasm";
       })[0];
 
       Assert.ok(!!source);
@@ -72,17 +71,17 @@ function test_source() {
         Assert.ok(response.contentType.includes("wasm"));
 
         const sourceContent = response.source;
         Assert.ok(!!sourceContent);
         Assert.equal(typeof sourceContent, "object");
         Assert.ok("binary" in sourceContent);
         Assert.equal(EXPECTED_CONTENT, sourceContent.binary);
 
-        gThreadClient.resume(function() {
+        gThreadClient.resume().then(function() {
           finishClient(gClient);
         });
       });
     });
   });
 
   /* eslint-disable comma-spacing, max-len */
   gDebuggee.eval("(" + function() {
--- a/devtools/server/tests/unit/test_xpcshell_debugging.js
+++ b/devtools/server/tests/unit/test_xpcshell_debugging.js
@@ -31,25 +31,25 @@ add_task(async function() {
   const onResumed = new Promise(resolve => {
     threadClient.addOneTimeListener("paused", (event, packet) => {
       equal(packet.why.type, "breakpoint",
           "yay - hit the breakpoint at the first line in our script");
       // Resume again - next stop should be our "debugger" statement.
       threadClient.addOneTimeListener("paused", (event, packet) => {
         equal(packet.why.type, "debuggerStatement",
               "yay - hit the 'debugger' statement in our script");
-        threadClient.resume(resolve);
+        threadClient.resume().then(resolve);
       });
       threadClient.resume();
     });
   });
 
   // tell the thread to do the initial resume.  This would cause the
   // xpcshell test harness to resume and load the file under test.
-  threadClient.resume(() => {
+  threadClient.resume().then(() => {
     // should have been told to resume the test itself.
     ok(testResumed);
     // Now load our test script.
     load(testFile.path);
     // and our "paused" listener above should get hit.
   });
 
   await onResumed;
--- a/devtools/shared/client/thread-client.js
+++ b/devtools/shared/client/thread-client.js
@@ -61,18 +61,16 @@ ThreadClient.prototype = {
    * @param [optional] object limit
    *        An object with a type property set to the appropriate limit (next,
    *        step, or finish) per the remote debugging protocol specification.
    *        Use null to specify no limit.
    * @param bool aRewind
    *        Whether execution should rewind until the limit is reached, rather
    *        than proceeding forwards. This parameter has no effect if the
    *        server does not support rewinding.
-   * @param function onResponse
-   *        Called with the response packet.
    */
   _doResume: DebuggerClient.requester({
     type: "resume",
     resumeLimit: arg(0),
     rewind: arg(1),
   }, {
     before: function(packet) {
       this._assertPaused("resume");
@@ -100,182 +98,140 @@ ThreadClient.prototype = {
     },
   }),
 
   /**
    * Reconfigure the thread actor.
    *
    * @param object options
    *        A dictionary object of the new options to use in the thread actor.
-   * @param function onResponse
-   *        Called with the response packet.
    */
   reconfigure: DebuggerClient.requester({
     type: "reconfigure",
     options: arg(0),
   }),
 
   /**
    * Resume a paused thread.
    */
-  resume: function(onResponse) {
-    return this._doResume(null, false, onResponse);
+  resume: function() {
+    return this._doResume(null, false);
   },
 
   /**
    * Resume then pause without stepping.
    *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  resumeThenPause: function(onResponse) {
-    return this._doResume({ type: "break" }, false, onResponse);
+  resumeThenPause: function() {
+    return this._doResume({ type: "break" }, false);
   },
 
   /**
    * Rewind a thread until a breakpoint is hit.
-   *
-   * @param function aOnResponse
-   *        Called with the response packet.
    */
-  rewind: function(onResponse) {
-    this._doResume(null, true, onResponse);
+  rewind: function() {
+    return this._doResume(null, true);
   },
 
   /**
    * Step over a function call.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  stepOver: function(onResponse) {
-    return this._doResume({ type: "next" }, false, onResponse);
+  stepOver: function() {
+    return this._doResume({ type: "next" }, false);
   },
 
   /**
    * Step into a function call.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  stepIn: function(onResponse) {
-    return this._doResume({ type: "step" }, false, onResponse);
+  stepIn: function() {
+    return this._doResume({ type: "step" }, false);
   },
 
   /**
    * Step out of a function call.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  stepOut: function(onResponse) {
-    return this._doResume({ type: "finish" }, false, onResponse);
+  stepOut: function() {
+    return this._doResume({ type: "finish" }, false);
   },
 
   /**
    * Rewind step over a function call.
-   *
-   * @param function aOnResponse
-   *        Called with the response packet.
    */
-  reverseStepOver: function(onResponse) {
-    return this._doResume({ type: "next" }, true, onResponse);
+  reverseStepOver: function() {
+    return this._doResume({ type: "next" }, true);
   },
 
   /**
    * Rewind step into a function call.
-   *
-   * @param function aOnResponse
-   *        Called with the response packet.
    */
-  reverseStepIn: function(onResponse) {
-    return this._doResume({ type: "step" }, true, onResponse);
+  reverseStepIn: function() {
+    return this._doResume({ type: "step" }, true);
   },
 
   /**
    * Rewind step out of a function call.
-   *
-   * @param function aOnResponse
-   *        Called with the response packet.
    */
-  reverseStepOut: function(onResponse) {
-    return this._doResume({ type: "finish" }, true, onResponse);
+  reverseStepOut: function() {
+    return this._doResume({ type: "finish" }, true);
   },
 
   /**
    * Immediately interrupt a running thread.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  interrupt: function(onResponse) {
-    return this._doInterrupt(null, onResponse);
+  interrupt: function() {
+    return this._doInterrupt(null);
   },
 
   /**
    * Pause execution right before the next JavaScript bytecode is executed.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
-  breakOnNext: function(onResponse) {
-    return this._doInterrupt("onNext", onResponse);
+  breakOnNext: function() {
+    return this._doInterrupt("onNext");
   },
 
   /**
    * Warp through time to an execution point in the past or future.
    *
    * @param object aTarget
    *        Description of the warp destination.
-   * @param function aOnResponse
-   *        Called with the response packet.
    */
-  timeWarp: function(target, onResponse) {
+  timeWarp: function(target) {
     const warp = () => {
-      this._doResume({ type: "warp", target }, true, onResponse);
+      this._doResume({ type: "warp", target }, true);
     };
     if (this.paused) {
-      warp();
-    } else {
-      this.interrupt(warp);
+      return warp();
     }
+    return this.interrupt().then(warp);
   },
 
   /**
    * Interrupt a running thread.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
   _doInterrupt: DebuggerClient.requester({
     type: "interrupt",
     when: arg(0),
   }),
 
   /**
    * Enable or disable pausing when an exception is thrown.
    *
    * @param boolean pauseOnExceptions
    *        Enables pausing if true, disables otherwise.
    * @param boolean ignoreCaughtExceptions
    *        Whether to ignore caught exceptions
-   * @param function onResponse
-   *        Called with the response packet.
    */
   pauseOnExceptions: DebuggerClient.requester({
     type: "pauseOnExceptions",
     pauseOnExceptions: arg(0),
     ignoreCaughtExceptions: arg(1),
   }),
 
   /**
    * Detach from the thread actor.
-   *
-   * @param function onResponse
-   *        Called with the response packet.
    */
   detach: DebuggerClient.requester({
     type: "detach",
   }, {
     after: function(response) {
       this.client.unregisterClient(this);
       return response;
     },
@@ -289,35 +245,30 @@ ThreadClient.prototype = {
    */
   threadGrips: DebuggerClient.requester({
     type: "threadGrips",
     actors: arg(0),
   }),
 
   /**
    * Request the loaded sources for the current thread.
-   *
-   * @param onResponse Function
-   *        Called with the thread's response.
    */
   getSources: DebuggerClient.requester({
     type: "sources",
   }),
 
   /**
    * Request frames from the callstack for the current thread.
    *
    * @param start integer
    *        The number of the youngest stack frame to return (the youngest
    *        frame is 0).
    * @param count integer
    *        The maximum number of frames to return, or null to return all
    *        frames.
-   * @param onResponse function
-   *        Called with the thread's response.
    */
   getFrames: DebuggerClient.requester({
     type: "frames",
     start: arg(0),
     count: arg(1),
   }),
 
   /**