Bug 1193731: basic ICE gathering state verification in mochitests r=mjf

MozReview-Commit-ID: Hmo64pFMOP7

--HG--
extra : rebase_source : 64dfb6f0f7fe86d53c44a516c341c80c40775a0c
This commit is contained in:
Nils Ohlmeier [:drno] 2016-11-19 11:19:50 -08:00
Родитель a1ec64b257
Коммит 1ae3b4665e
1 изменённых файлов: 9 добавлений и 5 удалений

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

@ -791,6 +791,13 @@ function PeerConnectionWrapper(label, configuration) {
}
};
this._pc.onicegatheringstatechange = e => {
isnot(typeof this._pc.iceGatheringState, "undefined",
"iceGetheringState should not be undefined");
var gatheringState = this._pc.iceGatheringState;
info(this + ": onicegatheringstatechange fired, new state is: " + gatheringState);
};
createOneShotEventWrapper(this, this._pc, 'datachannel');
this._pc.addEventListener('datachannel', e => {
var wrapper = new DataChannelWrapper(e.channel, this);
@ -1284,11 +1291,8 @@ PeerConnectionWrapper.prototype = {
this._pc.onicecandidate = () =>
ok(false, this.label + " received ICE candidate after end of trickle");
info(this.label + ": received end of trickle ICE event");
/* Bug 1193731. Accroding to WebRTC spec 4.3.1 the ICE Agent first sets
* the gathering state to completed (step 3.) before sending out the
* null newCandidate in step 4. */
todo(this._pc.iceGatheringState === 'completed',
"ICE gathering state has reached completed");
ok(this._pc.iceGatheringState === 'complete',
"ICE gathering state has reached complete");
resolveEndOfTrickle(this.label);
return;
}