Bug 1531148: Fix some test-cases that expect local and remote track ids to match, and re-enable those test-cases. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 11 Mar 2019 19:49:57 +0000
changeset 524431 2c058bf08a51637bed0dd86504b0426ce9c1f468
parent 524430 499be4d9123678e63e5944d80e89c0644d169679
child 524432 f0696ec9e92bb948060e8fac7c131637d31333a9
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
bugs1531148
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 1531148: Fix some test-cases that expect local and remote track ids to match, and re-enable those test-cases. r=jib Differential Revision: https://phabricator.services.mozilla.com/D22995
testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html.ini
testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html
deleted file mode 100644
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html.ini
+++ /dev/null
@@ -1,21 +0,0 @@
-[RTCPeerConnection-setRemoteDescription-tracks.https.html]
-  [addTrack() with a track and no stream makes ontrack fire with a track and no stream.]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531148
-
-  [addTrack() with two tracks and one stream makes ontrack fire twice with the tracks and shared stream.]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531148
-
-  [addTrack() for an existing stream makes stream.onaddtrack fire.]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531148
-
-  [addTrack() with a track and two streams makes ontrack fire with a track and two streams.]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531148
-
-  [addTrack() with a track and a stream makes ontrack fire with a track and a stream.]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531148
-
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html
@@ -22,36 +22,32 @@
     t.add_cleanup(() => caller.close());
     const callee = new RTCPeerConnection();
     t.add_cleanup(() => callee.close());
     const localStream =
         await getNoiseStream({audio: true});
     t.add_cleanup(() => localStream.getTracks().forEach(track => track.stop()));
     caller.addTrack(localStream.getTracks()[0]);
     const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => {
-      assert_equals(e.track.id, localStream.getTracks()[0].id,
-                    'Local and remote track IDs match.');
       assert_equals(e.streams.length, 0, 'No remote stream created.');
     });
     await exchangeOffer(caller, callee);
     await ontrackPromise;
   }, 'addTrack() with a track and no stream makes ontrack fire with a track and no stream.');
 
   promise_test(async t => {
     const caller = new RTCPeerConnection();
     t.add_cleanup(() => caller.close());
     const callee = new RTCPeerConnection();
     t.add_cleanup(() => callee.close());
     const localStream =
         await getNoiseStream({audio: true});
     t.add_cleanup(() => localStream.getTracks().forEach(track => track.stop()));
     caller.addTrack(localStream.getTracks()[0], localStream);
     const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => {
-      assert_equals(e.track.id, localStream.getTracks()[0].id,
-                    'Local and remote track IDs match.');
       assert_equals(e.streams.length, 1, 'Created a single remote stream.');
       assert_equals(e.streams[0].id, localStream.id,
                     'Local and remote stream IDs match.');
       assert_array_equals(e.streams[0].getTracks(), [e.track],
                           'The remote stream contains the remote track.');
     });
     await exchangeOffer(caller, callee);
     await ontrackPromise;
@@ -91,28 +87,22 @@
     caller.addTrack(localStreams[1].getTracks()[0], localStreams[0]);
     let ontrackEventsFired = 0;
     const ontrackEventResolvers = [ new Resolver(), new Resolver() ];
     callee.ontrack = t.step_func(e => {
       ontrackEventResolvers[ontrackEventsFired++].resolve(e);
     });
     await exchangeOffer(caller, callee);
     let firstTrackEvent = await ontrackEventResolvers[0];
-    assert_equals(firstTrackEvent.track.id,
-                  localStreams[0].getTracks()[0].id,
-                  'First ontrack\'s track ID matches first local track.');
     assert_equals(firstTrackEvent.streams.length, 1,
                   'First ontrack fires with a single stream.');
     assert_equals(firstTrackEvent.streams[0].id,
                   localStreams[0].id,
                   'First ontrack\'s stream ID matches local stream.');
     let secondTrackEvent = await ontrackEventResolvers[1];
-    assert_equals(secondTrackEvent.track.id,
-                  localStreams[1].getTracks()[0].id,
-                  'Second ontrack\'s track ID matches second local track.');
     assert_equals(secondTrackEvent.streams.length, 1,
                   'Second ontrack fires with a single stream.');
     assert_equals(secondTrackEvent.streams[0].id,
                   localStreams[0].id,
                   'Second ontrack\'s stream ID matches local stream.');
     assert_array_equals(firstTrackEvent.streams, secondTrackEvent.streams,
                         'ontrack was fired with the same streams both times.');
 
@@ -140,27 +130,26 @@
     const remoteStreams = [];
     callee.ontrack = e => {
       if (!remoteStreams.includes(e.streams[0]))
         remoteStreams.push(e.streams[0]);
     };
     exchangeIceCandidates(caller, callee);
     await exchangeOfferAnswer(caller, callee);
     assert_equals(remoteStreams.length, 1, 'One remote stream created.');
-    assert_equals(remoteStreams[0].getTracks()[0].id,
-                  localStreams[0].getTracks()[0].id,
-                  'First local and remote tracks have the same ID.');
-    const onaddtrackPromise =
-        addEventListenerPromise(t, remoteStreams[0], 'addtrack', e => {
-      assert_equals(e.track.id, localStreams[1].getTracks()[0].id,
-                    'Second local and remote tracks have the same ID.');
-    });
+    assert_equals(remoteStreams[0].id, localStreams[0].id,
+                  'First local and remote streams have the same ID.');
+    const firstRemoteTrack = remoteStreams[0].getTracks()[0];
+    const onaddtrackPromise = addEventListenerPromise(t, remoteStreams[0], 'addtrack');
     caller.addTrack(localStreams[1].getTracks()[0], localStreams[0]);
     await exchangeOffer(caller, callee);
-    await onaddtrackPromise;
+    const e = await onaddtrackPromise;
+    assert_equals(remoteStreams[0].getTracks().length, 2, 'stream has two tracks');
+    assert_not_equals(e.track.id, firstRemoteTrack.id,
+                      'addtrack event has a new track');
     assert_equals(remoteStreams.length, 1, 'Still a single remote stream.');
   }, 'addTrack() for an existing stream makes stream.onaddtrack fire.');
 
   promise_test(async t => {
     const caller = new RTCPeerConnection();
     t.add_cleanup(() => caller.close());
     const callee = new RTCPeerConnection();
     t.add_cleanup(() => callee.close());
@@ -201,18 +190,16 @@
       getNoiseStream({audio: true}),
       getNoiseStream({audio: true}),
     ]);
     t.add_cleanup(() => localStreams.forEach((stream) =>
       stream.getTracks().forEach((track) => track.stop())));
     caller.addTrack(localStreams[0].getTracks()[0],
                     localStreams[0], localStreams[1]);
     const ontrackPromise = addEventListenerPromise(t, callee, 'track', e => {
-      assert_equals(e.track.id, localStreams[0].getTracks()[0].id,
-                    'Local and remote track IDs match.');
       assert_equals(e.streams.length, 2, 'Two remote stream created.');
       assert_array_equals(e.streams[0].getTracks(), [e.track],
                           'First remote stream == [remote track].');
       assert_array_equals(e.streams[1].getTracks(), [e.track],
                           'Second remote stream == [remote track].');
       assert_equals(e.streams[0].id, localStreams[0].id,
                     'First local and remote stream IDs match.');
       assert_equals(e.streams[1].id, localStreams[1].id,