From 84b5c7241f3e262d0c5411875700d9e97a058590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= Date: Tue, 31 Jul 2018 01:14:47 -0700 Subject: [PATCH] Fix RTCPeerConnection-transceivers.https.html bug. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR accidentally made the "addTrack(0 streams)" test call addTrack() with a stream, which broke the tests: https://github.com/web-platform-tests/wpt/pull/12141 Test restored and all "addTrack/addTransceiver(X streams)" are made to consistently use "new MediaStream()" the same way. Bug: 869036 Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7 Reviewed-on: https://chromium-review.googlesource.com/1155125 Reviewed-by: Harald Alvestrand Commit-Queue: Henrik Boström Cr-Commit-Position: refs/heads/master@{#579341} --- webrtc/RTCPeerConnection-transceivers.https.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webrtc/RTCPeerConnection-transceivers.https.html b/webrtc/RTCPeerConnection-transceivers.https.html index 49f683911e61bf..c89737c99fcebe 100644 --- a/webrtc/RTCPeerConnection-transceivers.https.html +++ b/webrtc/RTCPeerConnection-transceivers.https.html @@ -321,7 +321,7 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); + const [track] = await createTrackAndStreamWithCleanup(t); pc1.addTransceiver(track, {streams:[]}); const trackEvent = await exchangeOfferAndListenToOntrack(t, pc1, pc2); assert_equals(trackEvent.streams.length, 0, 'trackEvent.streams.length == 0'); @@ -330,7 +330,8 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); + const [track] = await createTrackAndStreamWithCleanup(t); + const stream = new MediaStream(); pc1.addTransceiver(track, {streams:[stream]}); const trackEvent = await exchangeOfferAndListenToOntrack(t, pc1, pc2); assert_equals(trackEvent.streams.length, 1, 'trackEvent.streams.length == 1'); @@ -341,7 +342,7 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); + const [track] = await createTrackAndStreamWithCleanup(t); const stream0 = new MediaStream(); const stream1 = new MediaStream(); pc1.addTransceiver(track, {streams:[stream0, stream1]}); @@ -356,8 +357,8 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); - pc1.addTrack(track, stream); + const [track] = await createTrackAndStreamWithCleanup(t); + pc1.addTrack(track); const trackEvent = await exchangeOfferAndListenToOntrack(t, pc1, pc2); assert_equals(trackEvent.streams.length, 0, 'trackEvent.streams.length == 0'); }, 'addTrack(0 streams): ontrack fires with no stream'); @@ -365,7 +366,8 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); + const [track] = await createTrackAndStreamWithCleanup(t); + const stream = new MediaStream(); pc1.addTrack(track, stream); const trackEvent = await exchangeOfferAndListenToOntrack(t, pc1, pc2); assert_equals(trackEvent.streams.length, 1, 'trackEvent.streams.length == 1'); @@ -376,7 +378,7 @@ promise_test(async t => { const pc1 = createPeerConnectionWithCleanup(t); const pc2 = createPeerConnectionWithCleanup(t); - const [track, stream] = await createTrackAndStreamWithCleanup(t); + const [track] = await createTrackAndStreamWithCleanup(t); const stream0 = new MediaStream(); const stream1 = new MediaStream(); pc1.addTrack(track, stream0, stream1);