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
This commit is contained in:
Daisuke Akatsuka 2018-11-07 17:46:05 +00:00
Родитель 5e8c304c73
Коммит 1610592c49
4 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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();

Просмотреть файл

@ -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:

Просмотреть файл

@ -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());