Bug 1137813 - Part 4. Don't log the cleanup event as the server doesn't accept it after the room has been left. r=mikedeboer

This commit is contained in:
Mark Banner 2015-04-28 11:20:36 +01:00
Родитель 4926ad6112
Коммит fb94500173
2 изменённых файлов: 3 добавлений и 18 удалений

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

@ -440,7 +440,9 @@ loop.OTSdkDriver = (function() {
case "Session.connectionDestroyed":
this._metrics.connections--;
if (clientType === "local") {
state = "cleanup";
// Don't log this, as the server doesn't accept it after
// the room has been left.
return;
} else if (!this._metrics.connections) {
state = "waiting";
}

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

@ -420,23 +420,6 @@ describe("loop.OTSdkDriver", function () {
sinon.assert.calledOnce(publisher.destroy);
});
it("should dispatch a ConnectionStatus action", function() {
driver.session = session;
driver._metrics.connections = 1;
driver.disconnectSession();
sinon.assert.calledOnce(dispatcher.dispatch);
sinon.assert.calledWithExactly(dispatcher.dispatch,
new sharedActions.ConnectionStatus({
event: "Session.connectionDestroyed",
state: "cleanup",
connections: 0,
sendStreams: 0,
recvStreams: 0
}));
});
it("should call _noteConnectionLengthIfNeeded with connection duration", function() {
driver.session = session;
var startTime = 1;