blob: 301e582b109215e897d39579f2dda77ccc615eb4 [file] [log] [blame]
Test basic behavior of RTCPeerConnection.addTransceiver
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS pc.getTransceivers().length is 0
*** Test arguments
*** 'trackOrKind' argument is mandatory
PASS pc.addTransceiver() threw exception TypeError: Not enough arguments.
PASS pc.addTransceiver({}) threw exception TypeError: Type error.
*** Bad type as first argument
PASS pc.addTransceiver(null) threw exception TypeError: Type error.
PASS pc.addTransceiver(null, {}) threw exception TypeError: Type error.
PASS pc.addTransceiver(stream) threw exception TypeError: Type error.
*** Bad track kind
PASS pc.addTransceiver('foo') threw exception TypeError: Type error.
*** Bad direction value
PASS pc.addTransceiver("audio", {"direction": "foo"}) threw exception TypeError: Type error.
PASS transceiver = pc.addTransceiver("audio") did not throw exception.
PASS pc.getTransceivers().length is 1
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendrecv'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS transceiver = pc.addTransceiver("video") did not throw exception.
PASS pc.getTransceivers().length is 2
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendrecv'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'video'
PASS transceiver = pc.addTransceiver(audioTrack) did not throw exception.
PASS pc.getTransceivers().length is 3
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendrecv'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is audioTrack
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS transceiver = pc.addTransceiver(videoTrack) did not throw exception.
PASS pc.getTransceivers().length is 4
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendrecv'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is videoTrack
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'video'
PASS transceiver = pc.addTransceiver("audio", {"direction": "sendrecv"}) did not throw exception.
PASS pc.getTransceivers().length is 5
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendrecv'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS transceiver = pc.addTransceiver("audio", {"direction": "recvonly"}) did not throw exception.
PASS pc.getTransceivers().length is 6
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'recvonly'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS transceiver = pc.addTransceiver("audio", {"direction": "sendonly"}) did not throw exception.
PASS pc.getTransceivers().length is 7
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'sendonly'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS transceiver = pc.addTransceiver("audio", {"direction": "inactive"}) did not throw exception.
PASS pc.getTransceivers().length is 8
PASS pc.getTransceivers().includes(transceiver) is true
PASS transceiver.direction is 'inactive'
PASS transceiver.mid is null
PASS transceiver.stopped is false
*** Check sender
PASS transceiver.sender is an instance of RTCRtpSender
PASS transceiver.sender.track is null
*** Check receiver
PASS transceiver.receiver is an instance of RTCRtpReceiver
PASS transceiver.receiver.track is an instance of MediaStreamTrack
PASS transceiver.receiver.track.kind is 'audio'
PASS successfullyParsed is true
TEST COMPLETE