[web-platform-tests] Pull Request: Add initial test for RTCPeerConnection ondatachannel

wpt-pr-bot has just labeled a pull request from soareschen for https://github.com/w3c/web-platform-tests as "wg-webrtc":

== Add initial test for RTCPeerConnection ondatachannel ==
This is a work in progress. I added one basic test for establishing data channel connection with a remote peer and fire a `datachannel` event.

I also make use of this to test the state change of the peer connection and `RTC*Transport` objects. The idea is that for the `datachannel` event to be fired on a remote peer, it must first establish an SCTP connection and send the data channel negotiation through a `DATA_CHANNEL_OPEN` message. In other words by that time the `RTCDtlsTransport` and `RTCIceTransport` should have all been in connected state.

Other than that, since the test connection only have one `RTCDtlsTransport` and one `RTCIceTransport` and we know their final state, we can also test on the peer connection state.

There is only one thing that I am not very certain. Currently running on the test on Chrome, the `RTCIceConnectionState` is `connected` instead of `completed`. I am not sure if under TrickleICE, a DTLS connection can be established while the ICE agent is still attempting connection with each candidate pair. The current assumption for the test is that this is allowed, and the assertion allows the final `RTCIceConnectionState` to be either `connected` or `completed`. Would appreciate if anyone familar with this can confirm or correct me if I am wrong.

See https://github.com/w3c/web-platform-tests/pull/6186

Received on Thursday, 8 June 2017 10:13:30 UTC