[web-platform-tests] Pull Request: Add initial test for RTCPeerConnection.prototype.addTrack

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.prototype.addTrack ==
`addTrack()` requires creation of `MediaStreamTrack` instances to be tested. Usually this is acquired through `getUserMedia()`, but this is not convenient for testing purposes. (permission dialog, limited unique tracks, need fake media devices, etc) Instead here I make use of existing webrtc-pc APIs to generate `MediaStreamTrack`.

I wrote a `generateMediaStreamTrack()` helper that creates an `RTCPeerConnection`, call `addTransceiver`, and take the track from `RTCRtpReceiver`. This is supposed to be a remote track that when connected, plays media transferred from the remote peer. Adding this to another `RTCPeerConnection` effectively forward the remote track to another peer.

I think that as long as the test doesn't involve streaming the underlying media track, this approach should be sufficient to test most of the methods that accept `MediaStreamTrack`.

For convenience, I also added TODO coverage comment for `RTCPeerConnection-addTransceiver.html` in this PR.

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

Received on Wednesday, 14 June 2017 09:00:21 UTC