Bug 979627 - add more debug information to opening of data channels. r=bwc

This commit is contained in:
Nils Ohlmeier [:drno] 2014-10-21 11:23:00 +02:00
parent 659d8e76fa
commit 4851ed7121

View File

@ -1303,6 +1303,8 @@ DataChannelTest.prototype = Object.create(PeerConnectionTest.prototype, {
is(channel.readyState, "open", peer + " dataChannels[0] switched to state: 'open'"); is(channel.readyState, "open", peer + " dataChannels[0] switched to state: 'open'");
dcOpened = true; dcOpened = true;
onSuccess(); onSuccess();
} else {
info("dataChannelConnected() called, but data channel was open already");
} }
} }
@ -2606,11 +2608,12 @@ PeerConnectionWrapper.prototype = {
* Callback to execute when the data channel has been opened * Callback to execute when the data channel has been opened
*/ */
registerDataChannelOpenEvents : function (onDataChannelOpened) { registerDataChannelOpenEvents : function (onDataChannelOpened) {
info(this + ": Register callbacks for 'ondatachannel' and 'onopen'"); info(this + ": Register callback for 'ondatachannel'");
this.ondatachannel = function (targetChannel) { this.ondatachannel = function (targetChannel) {
targetChannel.onopen = onDataChannelOpened;
this.dataChannels.push(targetChannel); this.dataChannels.push(targetChannel);
info(this + ": 'ondatachannel' fired, registering 'onopen' callback");
targetChannel.onopen = onDataChannelOpened;
}; };
}, },