Bug 1190574: added missing calls to release stored ICE candidates. r?jib draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Mon, 14 Sep 2015 23:17:05 -0700
changeset 306551 926a19c8c719542ba80f4e389bba37f23377d74b
parent 306550 8c850071a79df67a30e0aa1a8d038f5f69fe6c36
child 510867 6b1eb778edff5778ea4bf8b1a6f82e01200df19c
push id7157
push userjbruaroey@mozilla.com
push dateWed, 04 Nov 2015 21:23:55 +0000
reviewersjib
bugs1190574
milestone45.0a1
Bug 1190574: added missing calls to release stored ICE candidates. r?jib
dom/media/tests/mochitest/templates.js
dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html
--- a/dom/media/tests/mochitest/templates.js
+++ b/dom/media/tests/mochitest/templates.js
@@ -459,36 +459,40 @@ var commandsPeerConnectionOfferAnswer = 
 
   function PC_LOCAL_CHECK_STATS(test) {
     return checkAllTrackStats(test.pcLocal);
   },
   function PC_REMOTE_CHECK_STATS(test) {
     return checkAllTrackStats(test.pcRemote);
   },
   function PC_LOCAL_VERIFY_SDP_AFTER_END_OF_TRICKLE(test) {
-    /* In case the endOfTrickleSdp promise is resolved already it will win the
-     * race because it gets evaluated first. But if endOfTrickleSdp is still
-     * pending the rejection will win the race. */
-    return Promise.race([
-      test.pcLocal.endOfTrickleSdp,
-      Promise.reject("No SDP")
-    ])
-    .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcLocal.label),
-          () => info("pcLocal: Gathering is not complete yet, skipping post-gathering SDP check"));
+    if (test.pcLocal.endOfTrickleSdp) {
+      /* In case the endOfTrickleSdp promise is resolved already it will win the
+       * race because it gets evaluated first. But if endOfTrickleSdp is still
+       * pending the rejection will win the race. */
+      return Promise.race([
+        test.pcLocal.endOfTrickleSdp,
+        Promise.reject("No SDP")
+      ])
+      .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcLocal.label),
+            () => info("pcLocal: Gathering is not complete yet, skipping post-gathering SDP check"));
+    }
   },
   function PC_REMOTE_VERIFY_SDP_AFTER_END_OF_TRICKLE(test) {
-    /* In case the endOfTrickleSdp promise is resolved already it will win the
-     * race because it gets evaluated first. But if endOfTrickleSdp is still
-     * pending the rejection will win the race. */
-    return Promise.race([
-      test.pcRemote.endOfTrickleSdp,
-      Promise.reject("No SDP")
-    ])
-    .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcRemote.label),
-          () => info("pcRemote: Gathering is not complete yet, skipping post-gathering SDP check"));
+    if (test.pcRemote.endOfTrickelSdp) {
+      /* In case the endOfTrickleSdp promise is resolved already it will win the
+       * race because it gets evaluated first. But if endOfTrickleSdp is still
+       * pending the rejection will win the race. */
+      return Promise.race([
+        test.pcRemote.endOfTrickleSdp,
+        Promise.reject("No SDP")
+      ])
+      .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcRemote.label),
+            () => info("pcRemote: Gathering is not complete yet, skipping post-gathering SDP check"));
+    }
   }
 ];
 
 function PC_LOCAL_REMOVE_VP8_FROM_OFFER(test) {
   isnot(test.originalOffer.sdp.search("H264/90000"), -1, "H.264 should be present in the SDP offer");
   test.originalOffer.sdp = sdputils.removeVP8(test.originalOffer.sdp);
   info("Updated H264 only offer: " + JSON.stringify(test.originalOffer));
 };
--- a/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html
+++ b/dom/media/tests/mochitest/test_peerConnection_syncSetDescription.html
@@ -16,25 +16,27 @@
 
 function PC_LOCAL_SET_LOCAL_DESCRIPTION_SYNC(test) {
   test.pcLocal.onsignalingstatechange = function() {};
   test.pcLocal._pc.setLocalDescription(test.originalOffer);
 }
 
 function PC_REMOTE_SET_REMOTE_DESCRIPTION_SYNC(test) {
   test.pcRemote.onsignalingstatechange = function() {};
-  test.pcRemote._pc.setRemoteDescription(test._local_offer);
+  test.pcRemote._pc.setRemoteDescription(test._local_offer,
+      test.pcRemote.releaseIceCandidates, function() {});
 }
 function PC_REMOTE_SET_LOCAL_DESCRIPTION_SYNC(test) {
   test.pcRemote.onsignalingstatechange = function() {};
   test.pcRemote._pc.setLocalDescription(test.originalAnswer);
 }
 function PC_LOCAL_SET_REMOTE_DESCRIPTION_SYNC(test) {
   test.pcLocal.onsignalingstatechange = function() {};
-  test.pcLocal._pc.setRemoteDescription(test._remote_answer);
+  test.pcLocal._pc.setRemoteDescription(test._remote_answer,
+    test.pcLocal.releaseIceCandidates, function() {});
 }
 
 runNetworkTest(() => {
   var test = new PeerConnectionTest();
   test.setMediaConstraints([{video: true}], [{video: true}]);
   test.chain.replace("PC_LOCAL_SET_LOCAL_DESCRIPTION", PC_LOCAL_SET_LOCAL_DESCRIPTION_SYNC);
   test.chain.replace("PC_REMOTE_SET_REMOTE_DESCRIPTION", PC_REMOTE_SET_REMOTE_DESCRIPTION_SYNC);
   test.chain.replace("PC_REMOTE_SET_LOCAL_DESCRIPTION", PC_REMOTE_SET_LOCAL_DESCRIPTION_SYNC);