diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index 09870566e1a..08baa4d40ff 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -4,7 +4,6 @@ support-files = head.js constraints.js mediaStreamPlayback.js - nonTrickleIce.js pc.js templates.js NetworkPreparationChromeScript.js @@ -92,12 +91,6 @@ skip-if = buildapp == 'b2g' || os == 'android' # bug 1043403 skip-if = toolkit == 'gonk' # b2g (Bug 1059867) [test_peerConnection_errorCallbacks.html] skip-if = toolkit == 'gonk' # b2g (Bug 1059867) -[test_peerConnection_noTrickleAnswer.html] -skip-if = toolkit == 'gonk' # b2g (Bug 1059867) -[test_peerConnection_noTrickleOffer.html] -skip-if = toolkit == 'gonk' # b2g (Bug 1059867) -[test_peerConnection_noTrickleOfferAnswer.html] -skip-if = toolkit == 'gonk' # b2g (Bug 1059867) [test_peerConnection_offerRequiresReceiveAudio.html] skip-if = toolkit == 'gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) [test_peerConnection_offerRequiresReceiveVideo.html] diff --git a/dom/media/tests/mochitest/nonTrickleIce.js b/dom/media/tests/mochitest/nonTrickleIce.js deleted file mode 100644 index 4d7e127f12a..00000000000 --- a/dom/media/tests/mochitest/nonTrickleIce.js +++ /dev/null @@ -1,133 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -function makeOffererNonTrickle(chain) { - chain.replace('PC_LOCAL_SETUP_ICE_HANDLER', [ - ['PC_LOCAL_SETUP_NOTRICKLE_ICE_HANDLER', - function (test) { - test.pcLocalWaitingForEndOfTrickleIce = false; - // We need to install this callback before calling setLocalDescription - // otherwise we might miss callbacks - test.pcLocal.setupIceCandidateHandler(test, function () { - // We ignore ICE candidates because we want the full offer - } , function (label) { - if (test.pcLocalWaitingForEndOfTrickleIce) { - // This callback is needed for slow environments where ICE - // trickling has not finished before the other side needs the - // full SDP. In this case, this call to test.next() will complete - // the PC_REMOTE_WAIT_FOR_OFFER step (see below). - info("Looks like we were still waiting for Trickle to finish"); - // TODO replace this with a Promise - test.next(); - } - }); - // We can't wait for trickle to finish here as it will only start once - // we have called setLocalDescription in the next step - test.next(); - } - ] - ]); - chain.replace('PC_REMOTE_GET_OFFER', [ - ['PC_REMOTE_WAIT_FOR_OFFER', - function (test) { - if (test.pcLocal.endOfTrickleIce) { - info("Trickle ICE finished already"); - test.next(); - } else { - info("Waiting for trickle ICE to finish"); - test.pcLocalWaitingForEndOfTrickleIce = true; - // In this case we rely on the callback from - // PC_LOCAL_SETUP_NOTRICKLE_ICE_HANDLER above to proceed to the next - // step once trickle is finished. - } - } - ], - ['PC_REMOTE_GET_FULL_OFFER', - function (test) { - test._local_offer = test.pcLocal.localDescription; - test._offer_constraints = test.pcLocal.constraints; - test._offer_options = test.pcLocal.offerOptions; - test.next(); - } - ] - ]); - chain.insertAfter('PC_REMOTE_SANE_REMOTE_SDP', [ - ['PC_REMOTE_REQUIRE_REMOTE_SDP_CANDIDATES', - function (test) { - info("test.pcLocal.localDescription.sdp: " + JSON.stringify(test.pcLocal.localDescription.sdp)); - info("test._local_offer.sdp" + JSON.stringify(test._local_offer.sdp)); - ok(!test.localRequiresTrickleIce, "Local does NOT require trickle"); - ok(test._local_offer.sdp.contains("a=candidate"), "offer has ICE candidates") - // TODO check for a=end-of-candidates once implemented - test.next(); - } - ] - ]); -} - -function makeAnswererNonTrickle(chain) { - chain.replace('PC_REMOTE_SETUP_ICE_HANDLER', [ - ['PC_REMOTE_SETUP_NOTRICKLE_ICE_HANDLER', - function (test) { - test.pcRemoteWaitingForEndOfTrickleIce = false; - // We need to install this callback before calling setLocalDescription - // otherwise we might miss callbacks - test.pcRemote.setupIceCandidateHandler(test, function () { - // We ignore ICE candidates because we want the full answer - }, function (label) { - if (test.pcRemoteWaitingForEndOfTrickleIce) { - // This callback is needed for slow environments where ICE - // trickling has not finished before the other side needs the - // full SDP. In this case this callback will call the step after - // PC_LOCAL_WAIT_FOR_ANSWER - info("Looks like we were still waiting for Trickle to finish"); - // TODO replace this with a Promise - test.next(); - } - }); - // We can't wait for trickle to finish here as it will only start once - // we have called setLocalDescription in the next step - test.next(); - } - ] - ]); - chain.replace('PC_LOCAL_GET_ANSWER', [ - ['PC_LOCAL_WAIT_FOR_ANSWER', - function (test) { - test._remote_answer = test.pcRemote.localDescription; - test._answer_constraints = test.pcRemote.constraints; - if (test.pcRemote.endOfTrickleIce) { - info("Trickle ICE finished already"); - test.next(); - } else { - info("Waiting for trickle ICE to finish"); - test.pcRemoteWaitingForEndOfTrickleIce = true; - // In this case we rely on the callback from - // PC_REMOTE_SETUP_NOTRICKLE_ICE_HANDLER above to proceed to the next - // step once trickle is finished. - } - } - ], - ['PC_LOCAL_GET_FULL_ANSWER', - function (test) { - test._local_offer = test.pcLocal.localDescription; - test._offer_constraints = test.pcLocal.constraints; - test._offer_options = test.pcLocal.offerOptions; - test.next(); - } - ] - ]); - chain.insertAfter('PC_LOCAL_SANE_REMOTE_SDP', [ - ['PC_LOCAL_REQUIRE_REMOTE_SDP_CANDIDATES', - function (test) { - info("test.pcRemote.localDescription.sdp: " + JSON.stringify(test.pcRemote.localDescription.sdp)); - info("test._remote_answer.sdp" + JSON.stringify(test._remote_answer.sdp)); - ok(!test.remoteRequiresTrickleIce, "Remote does NOT require trickle"); - ok(test._remote_answer.sdp.contains("a=candidate"), "answer has ICE candidates") - // TODO check for a=end-of-candidates once implemented - test.next(); - } - ] - ]); -} diff --git a/dom/media/tests/mochitest/pc.js b/dom/media/tests/mochitest/pc.js index 601d22f6342..0b1d3bc8672 100644 --- a/dom/media/tests/mochitest/pc.js +++ b/dom/media/tests/mochitest/pc.js @@ -224,20 +224,6 @@ CommandChain.prototype = { return null; }, - /** - * Replaces a single command. - * - * @param {string} id - * Identifier of the command to be replaced - * @param {Array[]} commands - * List of commands - * @returns {object[]} Removed commands - */ - replace : function (id, commands) { - this.insertBefore(id, commands); - return this.remove(id); - }, - /** * Replaces all commands after the specified one. * @@ -2099,22 +2085,18 @@ PeerConnectionWrapper.prototype = { * A PeerConnectionTest object to which the ice candidates gets * forwarded. */ - setupIceCandidateHandler : function - PCW_setupIceCandidateHandler(test, candidateHandler, endHandler) { + setupIceCandidateHandler : function PCW_setupIceCandidateHandler(test) { var self = this; self._local_ice_candidates = []; self._remote_ice_candidates = []; self._ice_candidates_to_add = []; - candidateHandler = candidateHandler || test.iceCandidateHandler.bind(test); - endHandler = endHandler || test.signalEndOfTrickleIce.bind(test); - function iceCandidateCallback (anEvent) { info(self.label + ": received iceCandidateEvent"); if (!anEvent.candidate) { info(self.label + ": received end of trickle ICE event"); self.endOfTrickleIce = true; - endHandler(self.label); + test.signalEndOfTrickleIce(self.label); } else { if (self.endOfTrickleIce) { ok(false, "received ICE candidate after end of trickle"); @@ -2125,7 +2107,7 @@ PeerConnectionWrapper.prototype = { ok(anEvent.candidate.sdpMid.length === 0, "SDP MID has length zero"); ok(typeof anEvent.candidate.sdpMLineIndex === 'number', "SDP MLine Index needs to exist"); self._local_ice_candidates.push(anEvent.candidate); - candidateHandler(self.label, anEvent.candidate); + test.iceCandidateHandler(self.label, anEvent.candidate); } } diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html deleted file mode 100644 index def81f23b8e..00000000000 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleAnswer.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - -
-
-
- - diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html deleted file mode 100644 index 0114b46696d..00000000000 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleOffer.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - -
-
-
- - diff --git a/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html b/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html deleted file mode 100644 index 10fc60d47d6..00000000000 --- a/dom/media/tests/mochitest/test_peerConnection_noTrickleOfferAnswer.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - -
-
-
- -