| Test behavior of RTCPeerConnection.addIceCandidate |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| |
| *** A remote description is needed before a candidate can be added |
| PASS pc.remoteDescription is null |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'foo', sdpMid: 0})) rejected with OperationError: Expect line: candidate:<candidate-str> |
| PASS Remote description set |
| |
| *** Define sdpMid, badSdpMid, sdpMLineIndex and badSdpMLineIndex for testing |
| PASS sdpMLineIndex is not badSdpMLineIndex |
| PASS sdpMid is not null |
| PASS sdpMid is not badSdpMid |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid})) rejected with OperationError: Error processing ICE candidate |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError: Error processing ICE candidate |
| *** A (bad) sdpMid takes precedesce over valid sdpMLineIndex |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid, sdpMLineIndex: sdpMLineIndex})) rejected with OperationError: Error processing ICE candidate |
| *** Test bad candidate content with valid sdpMid |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMid: sdpMid})) rejected with OperationError: Expect line: candidate:<candidate-str> |
| *** Test bad candidate content with valid sdpMLineIndex |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMLineIndex: sdpMLineIndex})) rejected with OperationError: Expect line: candidate:<candidate-str> |
| *** Test valid candidate with no mid and mlineindex |
| PASS promise pc.addIceCandidate({candidate: validCandidate}) rejected with TypeError: Candidate must not have both null sdpMid and sdpMLineIndex |
| |
| *** Test some OK input |
| PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid}) rejected with OperationError: Error processing ICE candidate |
| PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex}) fulfilled with undefined |
| PASS promise pc.addIceCandidate(undefined) fulfilled with undefined |
| PASS promise pc.addIceCandidate(null) fulfilled with undefined |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex})) fulfilled with undefined |
| PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError: Error processing ICE candidate |
| PASS End of test promise chain |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |