Bug 1119593 - Re-enable per-data-channel close, r=drno

--HG--
extra : rebase_source : be13d7e6b15d9f361b52d21ff18b51223fe65a85
This commit is contained in:
Martin Thomson 2015-01-27 12:35:58 -08:00
Родитель c2720cd85b
Коммит 2407d907e5
1 изменённых файлов: 5 добавлений и 19 удалений

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

@ -355,25 +355,11 @@ PeerConnectionTest.prototype.closePC = function() {
* Close the open data channels, followed by the underlying peer connection
*/
PeerConnectionTest.prototype.close = function() {
// TODO: Bug 1118398 - We should try to close data channels first here.
// return timerGuard(
//var allChannels = this.pcLocal ? this.pcLocal.dataChannels :
// this.pcRemote.dataChannels;
//Promise.all(allChannels.map((channel, i) => this.closeDataChannels(i))),
// 60000, "failed to close data channels")
// .then(() => this.closePC());
var expectOnClose = channel =>
(channel.onclose = () => info(channel + " closed"));
if (this.pcLocal) {
this.pcLocal.dataChannels.forEach(expectOnClose);
}
if (this.pcRemote) {
this.pcRemote.dataChannels.forEach(expectOnClose);
}
return this.closePC();
var allChannels = (this.pcLocal ? this.pcLocal : this.pcRemote).dataChannels;
return timerGuard(
Promise.all(allChannels.map((channel, i) => this.closeDataChannels(i))),
60000, "failed to close data channels")
.then(() => this.closePC());
};
/**