Bug 1620448: Have addIceCandidate's chained steps return rejected promise when remoteDescription is null. r=bwc

Differential Revision: https://phabricator.services.mozilla.com/D65637

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan-Ivar Bruaroey 2020-04-01 18:40:42 +00:00
Родитель 1ed2ab8ca7
Коммит b8a25afdf2
2 изменённых файлов: 10 добавлений и 5 удалений

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

@ -1294,7 +1294,16 @@ class RTCPeerConnection {
usernameFragment,
}) {
this._checkClosed();
return this._chain(() => {
return this._chain(async () => {
if (
!this._impl.pendingRemoteDescription.length &&
!this._impl.currentRemoteDescription.length
) {
throw new this._win.DOMException(
"No remoteDescription.",
"InvalidStateError"
);
}
return new Promise((resolve, reject) => {
this._onAddIceCandidateSuccess = resolve;
this._onAddIceCandidateError = reject;

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

@ -1,8 +1,4 @@
[RTCPeerConnection-operations.https.html]
[addIceCandidate must detect InvalidStateError synchronously when chain is empty]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1620448
expected: FAIL
[sender.getStats does NOT use the operations chain]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1620689
expected: FAIL