blob: a8d811791416584c461a17e31f7ac9c881369192 [file] [log] [blame]
Test RTCPeerConnection's legacy MediaStream-based API
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Stream sets should be empty initially
PASS pc.getLocalStreams().length is 0
PASS pc.getRemoteStreams().length is 0
Test with single track MediaStream
audioTrack = stream.getAudioTracks()[0]
PASS pc.addStream(stream) did not throw exception.
PASS pc.getLocalStreams().length is 1
PASS pc.getLocalStreams()[0] is stream
PASS pc.getStreamById(stream.id) is stream
PASS pc.getSenders().length is 1
PASS pc.getSenders()[0].track is audioTrack
Adding the same stream again should be a no-op
PASS pc.addStream(stream) did not throw exception.
PASS pc.getLocalStreams().length is 1
Test with audio and video MediaStream
audioTrack = stream.getAudioTracks()[0]
videoTrack = stream.getVideoTracks()[0]
PASS pc.addStream(stream) did not throw exception.
PASS pc.getLocalStreams().length is 2
PASS pc.getLocalStreams().includes(stream) is true
PASS pc.getStreamById(stream.id) is stream
PASS pc.getSenders().length is 3
PASS audioTrackFoundAmongSenders is true
PASS videoTrackFoundAmongSenders is true
Test removeStream
Remove a non-existent stream
otherStream = stream.clone()
PASS pc.removeStream(otherStream) did not throw exception.
Both streams should still be present
PASS pc.getLocalStreams().length is 2
PASS pc.removeStream(stream) did not throw exception.
PASS pc.getLocalStreams().length is 1
PASS pc.getStreamById(stream.id) is null
All senders should still be present
PASS pc.getSenders().length is 3
Removing the same stream again should be a no-op
PASS pc.removeStream(stream) did not throw exception.
PASS pc.getLocalStreams().length is 1
Test applying a remote description offering a stream with two tracks
Create remote offer
Got remote offer, set it
Remote offer set
PASS End of test promise chain
PASS successfullyParsed is true
TEST COMPLETE