зеркало из https://github.com/mozilla/gecko-dev.git
Bug 793947 - Race condition in dbg-server.js breaks Marionette; r=msucan
This commit is contained in:
Родитель
c4e22ba695
Коммит
8233647168
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче