Bug 1543425 - Part 0: Test-case for the bug. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 12 Apr 2019 20:43:25 +0000
changeset 469515 4e44a4a0495a
parent 469514 d525a800fe20
child 469516 90786b7142a8
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1543425
milestone68.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 1543425 - Part 0: Test-case for the bug. r=jib Differential Revision: https://phabricator.services.mozilla.com/D26931
testing/web-platform/tests/webrtc/RTCRtpTransceiver.https.html
--- a/testing/web-platform/tests/webrtc/RTCRtpTransceiver.https.html
+++ b/testing/web-platform/tests/webrtc/RTCRtpTransceiver.https.html
@@ -2183,16 +2183,46 @@
     assert_not_equals(pc2.getTransceivers()[3].mid, stoppedMid1);
 
     assert_equals(offer.sdp.match(/m=/g).length, 2,
                   "Exactly 2 m-lines in offer, because m-section was reused");
     assert_equals(offer.sdp.match(/m=audio 0 /g), null,
                   "No rejected m-line, because it was reused");
   };
 
+  const checkStopAfterCreateOfferWithReusedMsection = async t => {
+    const pc1 = new RTCPeerConnection();
+    t.add_cleanup(() => pc1.close());
+    const pc2 = new RTCPeerConnection();
+    t.add_cleanup(() => pc2.close());
+
+    const stream = await getNoiseStream({audio: true, video: true});
+    t.add_cleanup(() => stopTracks(stream));
+    const audio = stream.getAudioTracks()[0];
+    const video = stream.getVideoTracks()[0];
+
+    pc1.addTrack(audio, stream);
+    pc1.addTrack(video, stream);
+
+    await offerAnswer(pc1, pc2);
+    pc1.getTransceivers()[1].stop();
+    await offerAnswer(pc1, pc2);
+
+    // Second (video) m-section has been negotiated disabled.
+    const transceiver = pc1.addTransceiver("video");
+    const offer = await pc1.createOffer();
+    transceiver.stop();
+    await pc1.setLocalDescription(offer);
+    await pc2.setRemoteDescription(offer);
+
+    const answer = await pc2.createAnswer();
+    await pc2.setLocalDescription(answer);
+    await pc1.setRemoteDescription(answer);
+  };
+
 const tests = [
   checkAddTransceiverNoTrack,
   checkAddTransceiverWithTrack,
   checkAddTransceiverWithAddTrack,
   checkAddTransceiverWithDirection,
   checkAddTransceiverWithSetRemoteOfferSending,
   checkAddTransceiverWithSetRemoteOfferNoSend,
   checkAddTransceiverBadKind,
@@ -2217,12 +2247,13 @@ const tests = [
   checkStopAfterSetLocalOffer,
   checkStopAfterSetRemoteOffer,
   checkStopAfterCreateAnswer,
   checkStopAfterSetLocalAnswer,
   checkStopAfterClose,
   checkLocalRollback,
   checkRollbackAndSetRemoteOfferWithDifferentType,
   checkRemoteRollback,
-  checkMsectionReuse
+  checkMsectionReuse,
+  checkStopAfterCreateOfferWithReusedMsection
 ].forEach(test => promise_test(test, test.name));
 
 </script>