Bug 1437832 - Part 1: Test-case for addTransceiver, then addTrack, then removeTrack. r+jib r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 13 Feb 2018 13:21:29 -0600
changeset 458769 ec7939040da763bbfe29824cc615ee0168596af1
parent 458768 7eef30ef2103434125bd8d23de3af644eec2cebe
child 458770 57b2226d05e8516cc46cf14c4d362d254f0570f6
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1437832
milestone60.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 1437832 - Part 1: Test-case for addTransceiver, then addTrack, then removeTrack. r+jib r=jib MozReview-Commit-ID: 70hjut3HIsw
dom/media/tests/mochitest/test_peerConnection_transceivers.html
--- a/dom/media/tests/mochitest/test_peerConnection_transceivers.html
+++ b/dom/media/tests/mochitest/test_peerConnection_transceivers.html
@@ -780,16 +780,35 @@
         {currentDirection: "sendrecv"}
       ]);
 
     pc1.close();
     pc2.close();
     stopTracks(stream);
   };
 
+  let checkAddTrackExistingTransceiverThenRemove = async () => {
+    let pc = new RTCPeerConnection();
+    pc.addTransceiver("audio");
+    let stream = await getUserMedia({audio: true});
+    let audio = stream.getAudioTracks()[0];
+    let sender = pc.addTrack(audio, stream);
+    pc.removeTrack(sender);
+
+    // Cause transceiver to be associated
+    await pc.setLocalDescription(await pc.createOffer());
+
+    // Make sure add/remove works still
+    sender = pc.addTrack(audio, stream);
+    pc.removeTrack(sender);
+
+    pc.close();
+    stopTracks(stream);
+  };
+
   let checkRemoveTrackNegotiation = async () => {
     let pc1 = new RTCPeerConnection();
     let pc2 = new RTCPeerConnection();
     let stream = await getUserMedia({audio: true, video: true});
     let audio = stream.getAudioTracks()[0];
     pc1.addTrack(audio, stream);
     let video = stream.getVideoTracks()[0];
     pc1.addTrack(video, stream);
@@ -2193,16 +2212,17 @@
     await checkSendrecvWithTracklessStream();
     await checkAddTransceiverNoTrackDoesntPair();
     await checkAddTransceiverWithTrackDoesntPair();
     await checkAddTransceiverThenReplaceTrackDoesntPair();
     await checkAddTransceiverThenAddTrackPairs();
     await checkAddTrackPairs();
     await checkReplaceTrackNullDoesntPreventPairing();
     await checkRemoveAndReadd();
+    await checkAddTrackExistingTransceiverThenRemove();
     await checkRemoveTrackNegotiation();
     await checkMute();
     await checkOnAddStream();
     await checkStop();
     await checkStopAfterCreateOffer();
     await checkStopAfterSetLocalOffer();
     await checkStopAfterSetRemoteOffer();
     await checkStopAfterCreateAnswer();