Skip to content

Commit

Permalink
Fix bugs where transceivers could be associated with m-sections of an…
Browse files Browse the repository at this point in the history
…other type.

Bug 1496245 - Part 0: web-platform-test for rollback followed by SRD with different media type.

Bug 1496245 - Part 1: Allow SRD(offer) to stomp un-negotiated level mappings on our transceivers.

Bug 1496245 - Part 2: Don't create extra datachannel transceivers, just reuse (and possibly re-enable) the one we have.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1496245
gecko-commit: d7641a700ff64f760f0f8483a458f9870418141f
gecko-integration-branch: autoland
gecko-reviewers: mjf, jib
  • Loading branch information
docfaraday authored and moz-wptsync-bot committed Oct 25, 2018
1 parent 2606f3a commit 1ddb18e
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions webrtc/RTCRtpTransceiver.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,85 @@
hasProps(pc.getTransceivers(), [{ stopped: true }]);
};

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

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

const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close());

const videoStream = await navigator.mediaDevices.getUserMedia({video: true});
t.add_cleanup(() => stopTracks(videoStream));
const videoTrack = videoStream.getVideoTracks()[0];
pc2.addTrack(videoTrack, videoStream);

await pc1.setLocalDescription(await pc1.createOffer());
await pc1.setLocalDescription({type: "rollback"});

hasProps(pc1.getTransceivers(),
[
{
receiver: {track: {kind: "audio"}},
sender: {track: audioTrack},
direction: "sendrecv",
mid: null,
currentDirection: null,
stopped: false
}
]);

hasProps(pc2.getTransceivers(),
[
{
receiver: {track: {kind: "video"}},
sender: {track: videoTrack},
direction: "sendrecv",
mid: null,
currentDirection: null,
stopped: false
}
]);

await offerAnswer(pc2, pc1);

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

hasPropsAndUniqueMids(pc2.getTransceivers(),
[
{
receiver: {track: {kind: "video"}},
sender: {track: videoTrack},
direction: "sendrecv",
currentDirection: "sendonly",
stopped: false
}
]);

await offerAnswer(pc1, pc2);
};

const checkRemoteRollback = async t => {
const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
Expand Down Expand Up @@ -2270,6 +2349,7 @@
checkStopAfterSetLocalAnswer,
checkStopAfterClose,
checkLocalRollback,
checkRollbackAndSetRemoteOfferWithDifferentType,
checkRemoteRollback,
checkMsectionReuse
].forEach(test => promise_test(test, test.name));
Expand Down

0 comments on commit 1ddb18e

Please sign in to comment.