[Webkit-unassigned] [Bug 174314] RTCPeerConnection's close method should update signalingState
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jul 10 11:01:35 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=174314
--- Comment #1 from Mark Roberts <mroberts at twilio.com> ---
RTCPeerConnection's `close` method should also update `iceConnectionState`. Perhaps this issue could be tracked here, too, instead of a separate ticket.
Run the following code:
(async () => {
console.log('1. Constructing an RTCPeerConnection')
const pc = new RTCPeerConnection()
const iceConnectionStateChangeEvent = new Promise(resolve => pc.oniceconnectionstatechange = resolve)
console.log('2. Closing the RTCPeerConnection')
pc.close()
if (pc.iceConnectionState !== 'closed') {
console.error(`Expected the RTCPeerConnection's ICE connection state to be "closed", not "${pc.iceConnectionState}"`)
}
console.log('3. Awaiting a "iceconnectionstatechange" event')
await iceConnectionStateChangeEvent
console.log('Success!')
})()
Expected output (Firefox):
1. Constructing an RTCPeerConnection
2. Closing the RTCPeerConnection
Expected the RTCPeerConnection's ICE connection state to be "closed", not "new"
3. Awaiting a "iceconnectionstatechange" event
Success!
Actual output (Safari):
1. Constructing an RTCPeerConnection
2. Closing the RTCPeerConnection
Expected the RTCPeerConnection's ICE connection state to be "closed", not "new"
3. Awaiting a "iceconnectionstatechange" event
In the actual output, "Success!" never prints because `iceConnectionStateChangeEvent` never resolves. This behavior seems specified in the Step 4 of `close` and the description of "closed" in RTCIceConnectionState:
* http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-close
* http://w3c.github.io/webrtc-pc/#rtciceconnectionstate-enum
(Note: In Chrome, the error prints, too, I guess because `iceConnectionState` isn't updated synchronously?)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170710/8b7a0026/attachment-0001.html>
More information about the webkit-unassigned
mailing list