Skip to content

Commit

Permalink
Part 0: Add some test-cases for sdp without msid-semantics.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D23203

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1534673
gecko-commit: 05f0176414e72fea9214d49b5ff443bba1bb0d8b
gecko-integration-branch: central
gecko-reviewers: jib
  • Loading branch information
docfaraday authored and jgraham committed May 14, 2019
1 parent 3a6bbc7 commit b62398c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions webrtc/RTCTrackEvent-fire.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
a=ssrc:3 msid:3 2
`;

const sdp4 = sdp1.replace('msid-semantic', 'unknownattr');

const sdp5 = sdpBase + `
a=msid:-
`;

async function applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp)
{
const testTrackPromise = new Promise(resolve => {
Expand All @@ -56,6 +62,14 @@
return testTrackPromise;
}

promise_test(async test => {
const pc = new RTCPeerConnection();
test.add_cleanup(() => pc.close());

const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp0);
assert_equals(streams.length, 1, "track event has a stream");
}, "When a=msid is absent, the track should still be associated with a stream");

promise_test(async test => {
const pc = new RTCPeerConnection();
test.add_cleanup(() => pc.close());
Expand Down Expand Up @@ -89,6 +103,23 @@
assert_equals(streams[0].id, "1", "msid should match");
}, "Source-level msid should be ignored, or an error should be thrown, if a different media-level msid is present");

promise_test(async test => {
const pc = new RTCPeerConnection();
test.add_cleanup(() => pc.close());

const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp4);
assert_equals(streams.length, 1, "track event has a stream");
assert_equals(streams[0].id, "1", "msid should match");
}, "stream ids should be found even if msid-semantic is absent");

promise_test(async test => {
const pc = new RTCPeerConnection();
test.add_cleanup(() => pc.close());

const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp5);
assert_equals(streams.length, 0, "track event has no stream");
}, "a=msid:- should result in a track event with no streams");

promise_test(async test => {
const pc = new RTCPeerConnection();
test.add_cleanup(() => pc.close());
Expand Down

0 comments on commit b62398c

Please sign in to comment.