blob: dacc53bb7afe0f21cbe016b1afad37e56915001e [file] [log] [blame]
Test various arguments to RTCPeerConnection overloaded functions
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception.
*** Test createOffer
PASS promise pc.createOffer() did not reject with TypeError.
PASS promise pc.createOffer(emptyFunc, emptyFunc) did not reject with TypeError.
PASS promise pc.createOffer(null) did not reject with TypeError.
PASS promise pc.createOffer(undefined) did not reject with TypeError.
PASS promise pc.createOffer({}) did not reject with TypeError.
PASS promise pc.createOffer(emptyFunc, emptyFunc, null) did not reject with TypeError.
PASS promise pc.createOffer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
PASS promise pc.createOffer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
*** Options object must be last
PASS promise pc.createOffer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
*** Callbacks are not nullable
PASS promise pc.createOffer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
PASS promise pc.createOffer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
PASS promise pc.createOffer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
*** Bad input
PASS promise pc.createOffer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
PASS promise pc.createOffer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
PASS promise pc.createOffer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary
PASS promise pc.createOffer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createOffer must be a dictionary
*** Test createAnswer
PASS promise pc.createAnswer() did not reject with TypeError.
PASS promise pc.createAnswer(emptyFunc, emptyFunc) did not reject with TypeError.
PASS promise pc.createAnswer(null) did not reject with TypeError.
PASS promise pc.createAnswer(undefined) did not reject with TypeError.
PASS promise pc.createAnswer({}) did not reject with TypeError.
PASS promise pc.createAnswer(emptyFunc, emptyFunc, null) did not reject with TypeError.
PASS promise pc.createAnswer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
PASS promise pc.createAnswer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
*** Options object must be last
PASS promise pc.createAnswer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
*** Callbacks are not nullable
PASS promise pc.createAnswer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
PASS promise pc.createAnswer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
PASS promise pc.createAnswer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
*** Bad input
PASS promise pc.createAnswer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
PASS promise pc.createAnswer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
PASS promise pc.createAnswer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createAnswer must be a dictionary
PASS promise pc.createAnswer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createAnswer must be a dictionary
*** Test setLocalDescription
PASS promise pc.setLocalDescription(desc) did not reject with TypeError.
PASS promise pc.setLocalDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
*** desc is not optional
FAIL promise pc.setLocalDescription() rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription; expected reason TypeError: Not enough arguments
*** desc is not nullable
PASS promise pc.setLocalDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
*** Bad input as desc
PASS promise pc.setLocalDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
PASS promise pc.setLocalDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
*** Test setRemoteDescription
PASS promise pc.setRemoteDescription(desc) did not reject with TypeError.
PASS promise pc.setRemoteDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
*** desc is not optional
FAIL promise pc.setRemoteDescription() rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription; expected reason TypeError: Not enough arguments
*** desc is not nullable
PASS promise pc.setRemoteDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
*** Bad input as desc
PASS promise pc.setRemoteDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
PASS promise pc.setRemoteDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
*** Test addIceCandidate
PASS promise pc.addIceCandidate(candidate) did not reject with TypeError.
PASS promise pc.addIceCandidate(candidate, emptyFunc, emptyFunc) did not reject with TypeError.
PASS promise pc.addIceCandidate(null) did not reject with TypeError.
PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) did not reject with TypeError.
*** candidate is not optional
PASS promise pc.addIceCandidate() rejected with TypeError: Not enough arguments
PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
*** Bad input as candidate
PASS promise pc.addIceCandidate('foo') rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
PASS promise pc.addIceCandidate('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
PASS promise pc.addIceCandidate(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
*** Test getStats
PASS promise pc.getStats() did not reject with TypeError.
PASS promise pc.getStats(null) did not reject with TypeError.
PASS promise pc.getStats(selector) did not reject with TypeError.
PASS promise pc.getStats(null, emptyFunc, emptyFunc) did not reject with TypeError.
PASS promise pc.getStats(selector, emptyFunc, emptyFunc) did not reject with TypeError.
PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
*** Bad input as selector
PASS promise pc.getStats('foo') rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
PASS promise pc.getStats('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
PASS promise pc.getStats(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
PASS successfullyParsed is true
TEST COMPLETE