Bug 1518777 - make stoplisteners use promise style callbacks; r=ochameau
authoryulia <ystartsev@mozilla.com>
Thu, 24 Jan 2019 11:50:34 +0000
changeset 515280 e7cd613e6bfb2423c7ba506826524bb45c49d462
parent 515279 6a565ef5ffe71637d64eda3aeec2c44b41fdf3d7
child 515281 b9058c98eccb3427fec10fcfea7f87482ea33490
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1518777
milestone66.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 1518777 - make stoplisteners use promise style callbacks; r=ochameau Differential Revision: https://phabricator.services.mozilla.com/D16680
devtools/shared/webconsole/client.js
devtools/shared/webconsole/test/test_basics.html
--- a/devtools/shared/webconsole/client.js
+++ b/devtools/shared/webconsole/client.js
@@ -663,23 +663,23 @@ WebConsoleClient.prototype = {
    * @param array listeners
    *        Array of listeners you want to stop. See this.LISTENERS for
    *        known listeners.
    * @param function onResponse
    *        Function to invoke when the server response is received.
    * @return request
    *         Request object that implements both Promise and EventEmitter interfaces
    */
-  stopListeners: function(listeners, onResponse) {
+  stopListeners: function(listeners) {
     const packet = {
       to: this.actorID,
       type: "stopListeners",
       listeners: listeners,
     };
-    return this._client.request(packet, onResponse);
+    return this._client.request(packet);
   },
 
   /**
    * Return an instance of LongStringClient for the given long string grip.
    *
    * @param object grip
    *        The long string grip returned by the protocol.
    * @return object
--- a/devtools/shared/webconsole/test/test_basics.html
+++ b/devtools/shared/webconsole/test/test_basics.html
@@ -41,18 +41,18 @@ function onStartPageErrorAndConsoleAPI(a
   is(startedListeners.length, 2, "startedListeners.length");
   isnot(startedListeners.indexOf("PageError"), -1, "startedListeners: PageError");
   isnot(startedListeners.indexOf("ConsoleAPI"), -1,
         "startedListeners: ConsoleAPI");
   is(startedListeners.indexOf("foo"), -1, "startedListeners: no foo");
   ok(!aResponse.nativeConsoleAPI, "!nativeConsoleAPI");
 
   top.console = top.console_;
-  aState.client.stopListeners(["ConsoleAPI", "foo"],
-                              onStopConsoleAPI.bind(null, aState));
+  aState.client.stopListeners(["ConsoleAPI", "foo"])
+    .then(onStopConsoleAPI.bind(null, aState));
 }
 
 function onStopConsoleAPI(aState, aResponse)
 {
   is(aResponse.stoppedListeners.length, 1, "stoppedListeners.length");
   is(aResponse.stoppedListeners[0], "ConsoleAPI", "stoppedListeners: ConsoleAPI");
 
   closeDebugger(aState, function() {