diff --git a/dom/media/tests/mochitest/Makefile.in b/dom/media/tests/mochitest/Makefile.in index e13971ed1ac..76ab887273d 100644 --- a/dom/media/tests/mochitest/Makefile.in +++ b/dom/media/tests/mochitest/Makefile.in @@ -30,6 +30,9 @@ MOCHITEST_FILES = \ test_peerConnection_basicAudioVideoCombined.html \ test_peerConnection_basicVideo.html \ test_peerConnection_errorCallbacks.html \ + test_peerConnection_offerRequiresReceiveAudio.html \ + test_peerConnection_offerRequiresReceiveVideo.html \ + test_peerConnection_offerRequiresReceiveVideoAudio.html \ test_peerConnection_bug822674.html \ test_peerConnection_bug825703.html \ test_peerConnection_bug827843.html \ diff --git a/dom/media/tests/mochitest/pc.js b/dom/media/tests/mochitest/pc.js index 73611e7e3c8..254362500e2 100644 --- a/dom/media/tests/mochitest/pc.js +++ b/dom/media/tests/mochitest/pc.js @@ -359,6 +359,16 @@ function PCT_setMediaConstraints(constraintsLocal, constraintsRemote) { this.pcRemote.constraints = constraintsRemote; }; +/** + * Sets the media constraints used on a createOffer call in the test. + * + * @param {object} constraints the media constraints to use on createOffer + */ +PeerConnectionTest.prototype.setOfferConstraints = +function PCT_setOfferConstraints(constraints) { + this.pcLocal.offerConstraints = constraints; +}; + /** * Start running the tests as assigned to the command chain. */ @@ -399,6 +409,7 @@ function PeerConnectionWrapper(label, configuration) { this.label = label; this.constraints = [ ]; + this.offerConstraints = {}; this.streams = [ ]; info("Creating new PeerConnectionWrapper: " + this.label); @@ -525,7 +536,7 @@ PeerConnectionWrapper.prototype = { info("Got offer: " + JSON.stringify(offer)); self._last_offer = offer; onSuccess(offer); - }, unexpectedCallbackAndFinish); + }, unexpectedCallbackAndFinish, this.offerConstraints); }, /** diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html new file mode 100644 index 00000000000..f9cda2fbbff --- /dev/null +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+
+
+ + diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html new file mode 100644 index 00000000000..f734b318d01 --- /dev/null +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+
+
+ + diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html new file mode 100644 index 00000000000..6b50c27d50c --- /dev/null +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html @@ -0,0 +1,28 @@ + + + + + + + + + +
+
+
+ +