Bug 1531505 - Part 0: Update the expected behavior of a test-case, and add further testing. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 15 Mar 2019 18:04:05 +0000
changeset 464431 466d9c2c222d
parent 464430 0fb1354119e7
child 464432 129506229526
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1531505
milestone67.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 1531505 - Part 0: Update the expected behavior of a test-case, and add further testing. r=jib Differential Revision: https://phabricator.services.mozilla.com/D23201
testing/web-platform/meta/webrtc/RTCTrackEvent-fire.html.ini
testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
--- a/testing/web-platform/meta/webrtc/RTCTrackEvent-fire.html.ini
+++ b/testing/web-platform/meta/webrtc/RTCTrackEvent-fire.html.ini
@@ -1,9 +1,10 @@
 [RTCTrackEvent-fire.html]
   expected: TIMEOUT
-  [Applying a remote description with a new msid should trigger firing an event with populated streams]
+  [Applying a remote description with removed msid should trigger firing a removetrack event on the corresponding stream]
     expected: TIMEOUT
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531803
 
-  [Applying a remote description with removed msid should trigger firing a removetrack event on the corresponding stream]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531505
+  [Applying a remote description with a new msid should trigger firing an event with populated streams]
+    expected: NOTRUN
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531803
+
--- a/testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
+++ b/testing/web-platform/tests/webrtc/RTCTrackEvent-fire.html
@@ -31,32 +31,76 @@ const sdp0 = sdpBase + `
 `;
 
 const sdp1 = sdpBase + `
 a=msid:1 2
 a=ssrc:3 cname:4
 a=ssrc:3 msid:1 2
 `;
 
+const sdp2 = sdpBase + `
+a=ssrc:3 cname:4
+a=ssrc:3 msid:1 2
+`;
+
+const sdp3 = sdpBase + `
+a=msid:1 2
+a=ssrc:3 cname:4
+a=ssrc:3 msid:3 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;
 }
 
 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");
+}, "Source-level msid should be ignored if media-level msid is present");
+
+promise_test(async test => {
+    const pc = new RTCPeerConnection();
+    test.add_cleanup(() => pc.close());
+
+    const [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp2);
+    assert_equals(streams.length, 1, "track event has a stream");
+    assert_equals(streams[0].id, "1", "msid should match");
+}, "Source-level msid should be parsed if media-level msid is absent");
+
+promise_test(async test => {
+    const pc = new RTCPeerConnection();
+    test.add_cleanup(() => pc.close());
+
+    let track;
+    let streams;
+    try {
+      [track, streams] = await applyRemoteDescriptionAndReturnRemoteTrackAndStreams(pc, sdp3);
+    } catch (e) {
+      return;
+    }
+    assert_equals(streams.length, 1, "track event has a stream");
+    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, 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; });
     await pc.setRemoteDescription({type: 'offer', 'sdp': sdp0});
     await testTrackPromise;