merge m-c to fx-team

This commit is contained in:
Tim Taubert 2012-09-27 18:57:52 +02:00
commit 1347b30a58
2 changed files with 4 additions and 31 deletions

View File

@ -316,12 +316,10 @@ var DebuggerServer = {
},
/**
* Remove the connection from the debugging server and shut down the server
* if no other connections are open.
* Remove the connection from the debugging server.
*/
_connectionClosed: function DH_connectionClosed(aConnection) {
delete this._connections[aConnection.prefix];
this.destroy();
}
};

View File

@ -59,35 +59,10 @@ function test_socket_conn()
function test_socket_shutdown()
{
let count = 0;
wait_for_server_shutdown(count);
}
function wait_for_server_shutdown(aCount)
{
do_timeout(100, function() {
dump("count: "+aCount+" ");
if (++aCount > 20) {
do_throw("Timed out waiting for the server to shut down.");
return;
}
if (DebuggerServer.initialized) {
wait_for_server_shutdown(aCount);
return;
}
real_test_socket_shutdown(aCount);
});
}
function real_test_socket_shutdown()
{
// After the last conection was closed, the server must be initialized again.
// Allow incoming connections.
DebuggerServer.init(function () true);
DebuggerServer.addActors("resource://test/testactors.js");
do_check_eq(DebuggerServer._socketConnections, 1);
do_check_true(DebuggerServer.closeListener());
do_check_eq(DebuggerServer._socketConnections, 0);
// Make sure closing a non-started listener does nothing.
// Make sure closing the listener twice does nothing.
do_check_false(DebuggerServer.closeListener());
do_check_eq(DebuggerServer._socketConnections, 0);