Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1119593 - Re-enable per-data-channel close, r=drno
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Jan 28, 2015
1 parent 5c9c5d8 commit 3a3cfcd
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions dom/media/tests/mochitest/pc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
};

/**
Expand Down

0 comments on commit 3a3cfcd

Please sign in to comment.