Bug 1145407: Add mochitests that cause multiple tracks of the same type to be placed in the same remote stream. r=mt
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 19 Mar 2015 16:18:42 -0700
changeset 263918 32f1bd690587c12bf1d26dac96a237619ac695a7
parent 263917 badfefdddfc97d6128a23f347322464e7cfbbfb3
child 263919 b90bc6179915741f7bd449940446e56c393a03fd
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt
bugs1145407
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1145407: Add mochitests that cause multiple tracks of the same type to be placed in the same remote stream. r=mt
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_peerConnection_twoAudioTracksInOneStream.html
dom/media/tests/mochitest/test_peerConnection_twoVideoTracksInOneStream.html
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -141,22 +141,26 @@ skip-if = toolkit == 'gonk' # b2g (Bug 1
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 [test_peerConnection_throwInCallbacks.html]
 skip-if = toolkit == 'gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
 [test_peerConnection_toJSON.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 
 [test_peerConnection_twoAudioStreams.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
+[test_peerConnection_twoAudioTracksInOneStream.html]
+skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 [test_peerConnection_twoAudioVideoStreams.html]
 skip-if = (toolkit == 'gonk' || (e10s && debug)) # b2g (Bug 1059867) or fd exhaustion on e10s debug intermittent (Bug 1126078)
 [test_peerConnection_twoAudioVideoStreamsCombined.html]
 skip-if = (toolkit == 'gonk' || (e10s && debug)) # b2g (Bug 1059867) or fd exhaustion on e10s debug intermittent (Bug 1126078)
 [test_peerConnection_twoVideoStreams.html]
 skip-if = (toolkit == 'gonk' || (e10s && debug)) # b2g (Bug 1059867) or fd exhaustion on e10s debug intermittent (Bug 1126078)
+[test_peerConnection_twoVideoTracksInOneStream.html]
+skip-if = (toolkit == 'gonk' || (e10s && debug)) # b2g (Bug 1059867) or fd exhaustion on e10s debug intermittent (Bug 1126078)
 [test_peerConnection_addSecondAudioStream.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 [test_peerConnection_answererAddSecondAudioStream.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 [test_peerConnection_removeAudioTrack.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
 [test_peerConnection_removeThenAddAudioTrack.html]
 skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_peerConnection_twoAudioTracksInOneStream.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <script type="application/javascript" src="pc.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "1145407",
+    title: "Multistream: Two audio tracks in one stream"
+  });
+
+  var test;
+  runNetworkTest(function (options) {
+    test = new PeerConnectionTest(options);
+    test.chain.insertAfter("PC_REMOTE_GET_OFFER", [
+        function PC_REMOTE_OVERRIDE_STREAM_IDS_IN_OFFER(test) {
+          test._local_offer.sdp = test._local_offer.sdp.replace(
+              /a=msid:[^\s]*/g,
+              "a=msid:foo");
+        },
+        function PC_REMOTE_OVERRIDE_EXPECTED_STREAM_IDS(test) {
+          Object.keys(
+              test.pcRemote.expectedRemoteTrackTypesById).forEach(trackId => {
+                test.pcRemote.expectedRemoteTrackTypesById[trackId].streamId = "foo";
+              });
+        }
+    ]);
+    test.chain.insertAfter("PC_LOCAL_GET_ANSWER", [
+        function PC_LOCAL_OVERRIDE_STREAM_IDS_IN_ANSWER(test) {
+          test._remote_answer.sdp = test._remote_answer.sdp.replace(
+              /a=msid:[^\s]*/g,
+              "a=msid:foo");
+        },
+        function PC_LOCAL_OVERRIDE_EXPECTED_STREAM_IDS(test) {
+          Object.keys(
+              test.pcLocal.expectedRemoteTrackTypesById).forEach(trackId => {
+                test.pcLocal.expectedRemoteTrackTypesById[trackId].streamId = "foo";
+              });
+        }
+    ]);
+    test.setMediaConstraints([{audio: true}, {audio: true}],
+                             [{audio: true}, {audio: true}]);
+    test.run();
+  });
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_peerConnection_twoVideoTracksInOneStream.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <script type="application/javascript" src="pc.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "1145407",
+    title: "Multistream: Two video tracks in offerer stream"
+  });
+
+  var test;
+  runNetworkTest(function (options) {
+    test = new PeerConnectionTest(options);
+    test.chain.insertAfter("PC_REMOTE_GET_OFFER", [
+        function PC_REMOTE_OVERRIDE_STREAM_IDS_IN_OFFER(test) {
+          test._local_offer.sdp = test._local_offer.sdp.replace(
+              /a=msid:[^\s]*/g,
+              "a=msid:foo");
+        },
+        function PC_REMOTE_OVERRIDE_EXPECTED_STREAM_IDS(test) {
+          Object.keys(
+              test.pcRemote.expectedRemoteTrackTypesById).forEach(trackId => {
+                test.pcRemote.expectedRemoteTrackTypesById[trackId].streamId = "foo";
+              });
+        }
+    ]);
+    test.chain.insertAfter("PC_LOCAL_GET_ANSWER", [
+        function PC_LOCAL_OVERRIDE_STREAM_IDS_IN_ANSWER(test) {
+          test._remote_answer.sdp = test._remote_answer.sdp.replace(
+              /a=msid:[^\s]*/g,
+              "a=msid:foo");
+        },
+        function PC_LOCAL_OVERRIDE_EXPECTED_STREAM_IDS(test) {
+          Object.keys(
+              test.pcLocal.expectedRemoteTrackTypesById).forEach(trackId => {
+                test.pcLocal.expectedRemoteTrackTypesById[trackId].streamId = "foo";
+              });
+        }
+    ]);
+    test.setMediaConstraints([{video: true}, {video: true}],
+                             [{video: true}, {video: true}]);
+    test.run();
+  });
+</script>
+</pre>
+</body>
+</html>