blob: c2a80ba64a712127931c45a6418d03a441d5458f [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
PASS Got 'addstream' event (before setRemoteDescription promise fulfilled)
PASS remoteStream.getTracks().length is 2
PASS pc.getRemoteStreams().length is 1
PASS pc.getRemoteStreams()[0] is remoteStream
PASS pc.getStreamById(remoteStream.id) is remoteStream
Remote offer set
PASS End of test promise chain
PASS successfullyParsed is true
TEST COMPLETE