Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1534673] Part 0: Add some test-cases for sdp without msid-semantics. #16712

Merged
merged 1 commit into from May 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions webrtc/RTCTrackEvent-fire.html
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