Bug 1542907 - Part 0: Add test-case for duplicate msids. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 29 Apr 2019 15:52:06 +0000
changeset 530754 0f80cad005ba3ccad49740641f0fe404267ec535
parent 530753 d2ba7da778f0ec24b08c80c870ed0f86b42e6758
child 530755 3f1fac8a763c65f0b3aaec7d29fd357978375fd1
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1542907
milestone68.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 1542907 - Part 0: Add test-case for duplicate msids. r=jib Differential Revision: https://phabricator.services.mozilla.com/D27116
testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
--- a/testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
+++ b/testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
@@ -48,16 +48,21 @@ a=ssrc:3 msid:3 2
 `;
 
 const sdp4 = sdp1.replace('msid-semantic', 'unknownattr');
 
 const sdp5 = sdpBase + `
 a=msid:-
 `;
 
+const sdp6 = sdpBase + `
+a=msid:1 2
+a=msid:1 2
+`;
+
 async function applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp)
 {
     const testTrackPromise = new Promise(resolve  => {
         pc.ontrack = (event) => { resolve([event.track, event.streams]); };
     });
     await pc.setRemoteDescription({type: 'offer', sdp: sdp});
     return testTrackPromise;
 }
@@ -119,16 +124,24 @@ promise_test(async test => {
     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());
 
+    const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp6);
+    assert_equals(streams.length, 1, "track event has one stream");
+}, "Duplicate a=msid should result in a track event with one stream");
+
+promise_test(async test => {
+    const pc = new RTCPeerConnection();
+    test.add_cleanup(() => pc.close());
+
     const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp1);
     assert_equals(streams.length, 1, "track event has a stream");
     assert_equals(streams[0].id, "1", "msid should match");
     const stream = streams[0];
 
     await pc.setLocalDescription(await pc.createAnswer());
 
     const testTrackPromise = new Promise((resolve) => { stream.onremovetrack = resolve; });