Skip to content

Commit

Permalink
Create answers with a=mid even if the offer did not have a=mid
Browse files Browse the repository at this point in the history
Bug 1495569 - Part 0: web-platform-test that verifies handling of offer without mid.
Bug 1495569 - Part 1: Ensure that answers are created with the transceiver's mid when the offer did not have a mid.

Differential Revision: https://phabricator.services.mozilla.com/D8853

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1495569
gecko-commit: 19b1ad6ceade3ce4ce42e9b4dd793f03e5e81be9
gecko-integration-branch: autoland
gecko-reviewers: mid, mid, mjf, jib
  • Loading branch information
docfaraday authored and moz-wptsync-bot committed Oct 17, 2018
1 parent 5acd3bc commit 07052a8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions webrtc/RTCRtpTransceiver.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,40 @@
hasProps(pc.getTransceivers(), []);
};

const checkNoMidOffer = async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());

const stream = await navigator.mediaDevices.getUserMedia({audio: true});
t.add_cleanup(() => stopTracks(stream));
const track = stream.getAudioTracks()[0];
pc1.addTrack(track, stream);

const offer = await pc1.createOffer();
await pc1.setLocalDescription(offer);

// Remove mid attr
offer.sdp = offer.sdp.replace("a=mid:", "a=unknownattr:");
await pc2.setRemoteDescription(offer);

hasPropsAndUniqueMids(pc2.getTransceivers(),
[
{
receiver: {track: {kind: "audio"}},
sender: {track: null},
direction: "recvonly",
currentDirection: null,
stopped: false
}
]);

const answer = await pc2.createAnswer();
await pc2.setLocalDescription(answer);
await pc1.setRemoteDescription(answer);
};

const checkAddTransceiverNoTrackDoesntPair = async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
Expand Down Expand Up @@ -2212,6 +2246,7 @@
checkAddTransceiverWithSetRemoteOfferSending,
checkAddTransceiverWithSetRemoteOfferNoSend,
checkAddTransceiverBadKind,
checkNoMidOffer,
checkSetDirection,
checkCurrentDirection,
checkSendrecvWithNoSendTrack,
Expand Down

0 comments on commit 07052a8

Please sign in to comment.