From 1610592c49f7f77120ab6ae1ce8bb70595edb78a Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 7 Nov 2018 17:46:05 +0000 Subject: [PATCH] Bug 1497448: Rename closeAllListener to closeAllSocketListeners. r=ochameau,jdescottes Depends on D10868 Differential Revision: https://phabricator.services.mozilla.com/D11150 --HG-- extra : moz-landing-system : lando --- devtools/server/main.js | 4 ++-- devtools/server/tests/unit/test_dbgglobal.js | 12 ++++++------ devtools/shared/security/socket.js | 2 +- .../shared/transport/tests/unit/test_dbgsocket.js | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/devtools/server/main.js b/devtools/server/main.js index fd2cbdd84a8b..1f59c9d4a786 100644 --- a/devtools/server/main.js +++ b/devtools/server/main.js @@ -113,7 +113,7 @@ var DebuggerServer = { ActorRegistry.destroy(); - this.closeAllListeners(); + this.closeAllSocketListeners(); this._initialized = false; dumpn("Debugger server is shut down."); @@ -234,7 +234,7 @@ var DebuggerServer = { * @return boolean * Whether any listeners were actually closed. */ - closeAllListeners() { + closeAllSocketListeners() { if (!this.listeningSockets) { return false; } diff --git a/devtools/server/tests/unit/test_dbgglobal.js b/devtools/server/tests/unit/test_dbgglobal.js index 982434295d54..c741e9409d8a 100644 --- a/devtools/server/tests/unit/test_dbgglobal.js +++ b/devtools/server/tests/unit/test_dbgglobal.js @@ -12,9 +12,9 @@ function run_test() { Assert.throws(() => DebuggerServer.addSocketListener(socketListener), /DebuggerServer has not been initialized/, "addSocketListener should throw before it has been initialized"); - Assert.throws(DebuggerServer.closeAllListeners, + Assert.throws(DebuggerServer.closeAllSocketListeners, /this is undefined/, - "closeAllListeners should throw before it has been initialized"); + "closeAllSocketListeners should throw before it has been initialized"); Assert.throws(DebuggerServer.connectPipe, /this is undefined/, "connectPipe should throw before it has been initialized"); @@ -24,19 +24,19 @@ function run_test() { // These should still fail because we haven't added a createRootActor // implementation yet. - Assert.throws(DebuggerServer.closeAllListeners, + Assert.throws(DebuggerServer.closeAllSocketListeners, /this is undefined/, - "closeAllListeners should throw if createRootActor hasn't been added"); + "closeAllSocketListeners should throw if createRootActor hasn't been added"); Assert.throws(DebuggerServer.connectPipe, /this is undefined/, - "closeAllListeners should throw if createRootActor hasn't been added"); + "closeAllSocketListeners should throw if createRootActor hasn't been added"); const { createRootActor } = require("xpcshell-test/testactors"); DebuggerServer.setRootActor(createRootActor); // Now they should work. DebuggerServer.addSocketListener(socketListener); - DebuggerServer.closeAllListeners(); + DebuggerServer.closeAllSocketListeners(); // Make sure we got the test's root actor all set up. const client1 = DebuggerServer.connectPipe(); diff --git a/devtools/shared/security/socket.js b/devtools/shared/security/socket.js index 2ba591df9312..d79cfa606c06 100644 --- a/devtools/shared/security/socket.js +++ b/devtools/shared/security/socket.js @@ -771,7 +771,7 @@ ServerSocketConnection.prototype = { }); switch (result) { case AuthenticationResult.DISABLE_ALL: - this._listener._debuggerServer.closeAllListeners(); + this._listener._debuggerServer.closeAllSocketListeners(); Services.prefs.setBoolPref("devtools.debugger.remote-enabled", false); return promise.reject(Cr.NS_ERROR_CONNECTION_REFUSED); case AuthenticationResult.DENY: diff --git a/devtools/shared/transport/tests/unit/test_dbgsocket.js b/devtools/shared/transport/tests/unit/test_dbgsocket.js index 18e267520b08..8b9d812fb18d 100644 --- a/devtools/shared/transport/tests/unit/test_dbgsocket.js +++ b/devtools/shared/transport/tests/unit/test_dbgsocket.js @@ -77,10 +77,10 @@ async function test_socket_shutdown() { Assert.equal(DebuggerServer.listeningSockets, 2); gExtraListener.close(); Assert.equal(DebuggerServer.listeningSockets, 1); - Assert.ok(DebuggerServer.closeAllListeners()); + Assert.ok(DebuggerServer.closeAllSocketListeners()); Assert.equal(DebuggerServer.listeningSockets, 0); // Make sure closing the listener twice does nothing. - Assert.ok(!DebuggerServer.closeAllListeners()); + Assert.ok(!DebuggerServer.closeAllSocketListeners()); Assert.equal(DebuggerServer.listeningSockets, 0); info("Connecting to a server socket at " + new Date().toTimeString());