Bug 1263312 - Update most tests to skip RTCIceCandidate construction. r=drno
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 09 Nov 2016 02:01:08 -0500
changeset 325574 ede4f590709f6312f4198e645bc660771f9be0e3
parent 325573 1e7047778ccefcdfd580bcd645d535a1ed18c6e6
child 325575 ce72565dbefdc9256277f482c7bd7b0b8a2f44dd
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersdrno
bugs1263312
milestone53.0a1
Bug 1263312 - Update most tests to skip RTCIceCandidate construction. r=drno MozReview-Commit-ID: DBjVR5GrwQ3
dom/media/tests/mochitest/templates.js
dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
dom/media/tests/mochitest/test_peerConnection_closeDuringIce.html
dom/media/tests/mochitest/test_peerConnection_iceFailure.html
--- a/dom/media/tests/mochitest/templates.js
+++ b/dom/media/tests/mochitest/templates.js
@@ -113,17 +113,17 @@ var checkAllTrackStats = pc => {
 // Commands run once at the beginning of each test, even when performing a
 // renegotiation test.
 var commandsPeerConnectionInitial = [
   function PC_SETUP_SIGNALING_CLIENT(test) {
     if (test.testOptions.steeplechase) {
       test.setupSignalingClient();
       test.registerSignalingCallback("ice_candidate", function (message) {
         var pc = test.pcRemote ? test.pcRemote : test.pcLocal;
-        pc.storeOrAddIceCandidate(new RTCIceCandidate(message.ice_candidate));
+        pc.storeOrAddIceCandidate(message.ice_candidate);
       });
       test.registerSignalingCallback("end_of_trickle_ice", function (message) {
         test.signalingMessagesFinished();
       });
     }
   },
 
   function PC_LOCAL_SETUP_ICE_LOGGER(test) {
--- a/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
+++ b/dom/media/tests/mochitest/test_peerConnection_addIceCandidate.html
@@ -14,19 +14,19 @@
   var test;
   runNetworkTest(function () {
     test = new PeerConnectionTest();
     test.setMediaConstraints([{audio: true}], [{audio: true}]);
     test.chain.removeAfter("PC_LOCAL_GET_ANSWER");
 
     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 => {
             is(err.name, "InvalidStateError", "Error is InvalidStateError");
           });
         }
     ]);
     test.chain.insertAfter("PC_REMOTE_SET_LOCAL_DESCRIPTION", [
@@ -61,19 +61,19 @@
         .then(
           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"));
       },
       // bug 1095793
       function PC_REMOTE_ADD_MISMATCHED_MID_AND_LEVEL_CANDIDATE(test) {
         var bogus = new mozRTCIceCandidate(
           {candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
            sdpMLineIndex: 0,
@@ -85,17 +85,17 @@
       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"));
       }
     ]);
     test.run();
--- a/dom/media/tests/mochitest/test_peerConnection_closeDuringIce.html
+++ b/dom/media/tests/mochitest/test_peerConnection_closeDuringIce.html
@@ -16,22 +16,22 @@
 
 function PC_LOCAL_SETUP_NULL_ICE_HANDLER(test) {
   test.pcLocal.setupIceCandidateHandler(test, function() {}, function () {});
 }
 function PC_REMOTE_SETUP_NULL_ICE_HANDLER(test) {
   test.pcRemote.setupIceCandidateHandler(test, function() {}, function () {});
 }
 function PC_REMOTE_ADD_FAKE_ICE_CANDIDATE(test) {
-  var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
+  var cand = {"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0};
   test.pcRemote.storeOrAddIceCandidate(cand);
   info(test.pcRemote + " Stored fake candidate: " + JSON.stringify(cand));
 }
 function PC_LOCAL_ADD_FAKE_ICE_CANDIDATE(test) {
-  var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
+  var cand = {"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0};
     test.pcLocal.storeOrAddIceCandidate(cand);
   info(test.pcLocal + " Stored fake candidate: " + JSON.stringify(cand));
 }
 function PC_LOCAL_CLOSE_DURING_ICE(test) {
   return test.pcLocal.iceChecking.then(() => {
     test.pcLocal.onsignalingstatechange = function () {};
     test.pcLocal.close();
     });
--- a/dom/media/tests/mochitest/test_peerConnection_iceFailure.html
+++ b/dom/media/tests/mochitest/test_peerConnection_iceFailure.html
@@ -15,22 +15,22 @@
 
 function PC_LOCAL_SETUP_NULL_ICE_HANDLER(test) {
   test.pcLocal.setupIceCandidateHandler(test, function() {}, function () {});
 }
 function PC_REMOTE_SETUP_NULL_ICE_HANDLER(test) {
   test.pcRemote.setupIceCandidateHandler(test, function() {}, function () {});
 }
 function PC_REMOTE_ADD_FAKE_ICE_CANDIDATE(test) {
-  var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
+  var cand = {"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0};
   test.pcRemote.storeOrAddIceCandidate(cand);
   info(test.pcRemote + " Stored fake candidate: " + JSON.stringify(cand));
 }
 function PC_LOCAL_ADD_FAKE_ICE_CANDIDATE(test) {
-  var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
+  var cand = {"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0};
     test.pcLocal.storeOrAddIceCandidate(cand);
   info(test.pcLocal + " Stored fake candidate: " + JSON.stringify(cand));
 }
 function PC_LOCAL_WAIT_FOR_ICE_FAILURE(test) {
   return test.pcLocal.iceFailed.then(() => {
     ok(true, this.pcLocal + " Ice Failure Reached.");
 	});
 }