summaryrefslogtreecommitdiff
path: root/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html')
-rw-r--r--dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html43
1 files changed, 23 insertions, 20 deletions
diff --git a/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html b/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
index 93cbdd0832..ba0039a513 100644
--- a/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
+++ b/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
@@ -19,9 +19,9 @@
test.chain.insertAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION", [
function PC_LOCAL_ADD_CANDIDATE_EARLY(test) {
- var candidate = new RTCIceCandidate(
- {candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
- sdpMLineIndex: 0});
+ var candidate = {
+ candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
+ sdpMLineIndex: 0};
return test.pcLocal._pc.addIceCandidate(candidate).then(
generateErrorCallback("addIceCandidate should have failed."),
err => {
@@ -54,23 +54,23 @@
}
);
},
- function PC_REMOTE_ADD_CANDIDATE_MISSING_INDEX(test) {
- // Note: it is probably not a good idea to automatically fill a missing
- // MLineIndex with a default value of zero, see bug 1157034
+ function PC_REMOTE_ADD_MISSING_MID_AND_MISSING_INDEX(test) {
var broken = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host"});
return test.pcRemote._pc.addIceCandidate(broken)
.then(
- // FIXME this needs to be updated once bug 1157034 is fixed
- todo(false, "Missing index in got automatically set to a valid value bz://1157034")
+ generateErrorCallback("addIceCandidate should have failed."),
+ err => {
+ is(err.name, "TypeError", "Error is TypeError");
+ }
);
},
function PC_REMOTE_ADD_VALID_CANDIDATE(test) {
- var candidate = new RTCIceCandidate(
- {candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
- sdpMLineIndex: 0});
+ var candidate = {
+ candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
+ sdpMLineIndex: 0};
return test.pcRemote._pc.addIceCandidate(candidate)
- .then(ok(true, "Successfully added valid ICE candidate"));
+ .then(() => ok(true, "Successfully added valid ICE candidate"));
},
// bug 1095793
function PC_REMOTE_ADD_MISMATCHED_MID_AND_LEVEL_CANDIDATE(test) {
@@ -79,20 +79,23 @@
sdpMLineIndex: 0,
sdpMid: "sdparta_1"});
return test.pcRemote._pc.addIceCandidate(bogus)
- .then(
- generateErrorCallback("addIceCandidate should have failed."),
- err => {
- is(err.name, "InvalidCandidateError", "Error is InvalidCandidateError");
- }
- );
+ .then(generateErrorCallback("addIceCandidate should have failed."),
+ err => is(err.name, "InvalidCandidateError", "Error is InvalidCandidateError"));
+ },
+ function PC_REMOTE_ADD_MID_AND_MISSING_INDEX(test) {
+ var candidate = new RTCIceCandidate(
+ {candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
+ sdpMid: "sdparta_0"});
+ return test.pcRemote._pc.addIceCandidate(candidate)
+ .then(() => ok(true, "Successfully added valid ICE candidate"));
},
function PC_REMOTE_ADD_MATCHING_MID_AND_LEVEL_CANDIDATE(test) {
- var candidate = new mozRTCIceCandidate(
+ var candidate = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
sdpMLineIndex: 0,
sdpMid: "sdparta_0"});
return test.pcRemote._pc.addIceCandidate(candidate)
- .then(ok(true, "Successfully added valid ICE candidate with matching mid and level"));
+ .then(() => ok(true, "Successfully added valid ICE candidate with matching mid and level"));
}
]);
test.run();