Skip to content

merge_pr_7777

These are behavior-driven tests, each test testing a specific behavior:
- addTrack() with a track and no stream should fire ontrack with a
  remote track with the same ID and no streams.
- addTrack() with a track and a stream should fire ontrack with a
  remote track and stream with matching IDs.
- addTrack() with two tracks and a shared stream should fire ontrack
  twice with remote tracks and a shared remote stream, with matching
  IDs.
- addTrack() with a track and two streams should fire ontrack with a
  track and two streams with matching IDs.
- ontrack should fire before setRemoteDescription()'s promise resolves.
- ontrack's receiver should match getReceivers().
- removeTrack() should not result in a receiver being removed.

Unlike RTCPeerConnection-ontrack.https.html, these tests do not rely on
transceiver support. When testing a behavior like "fires an event with
a track" the test does not test unrelated things like the event being a
complete implementation of RTCTrackEvent with transceivers and all.

In a follow-up, I will add tests for other behavior associated with the
removal of a track, including onmute events firing and the track being
removed from the remote streams.

Bug: 774303
Change-Id: I87d8a79d9e2e385610f749a9146b740cc649cf3f
Reviewed-on: https://chromium-review.googlesource.com/719615
Commit-Queue: Henrik Boström <[email protected]>
Reviewed-by: Taylor Brandstetter <[email protected]>
Reviewed-by: Philip Jägenstedt <[email protected]>
Cr-Commit-Position: refs/heads/master@{#510241}
Assets 2
Loading