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 525318 466d9c2c222dff3d7b8e64658dad991c48cb5518
parent 525317 0fb1354119e7fbc2da3bc65b360c930f394c1bae
child 525319 12950622952644a4f7bff0e5b776d84dc81a1224
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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;