From d10c24ea6aabbb55cd12d97d95760922fd6d8b85 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Fri, 8 Mar 2019 04:15:35 +0000 Subject: [PATCH] Bug 1531094: Fix a couple of test-cases that want to see rtp stats before RTP has started. Update meta file to reflect what is still missing. r=jib Depends on D21557 Differential Revision: https://phabricator.services.mozilla.com/D21986 --HG-- extra : moz-landing-system : lando --- .../RTCPeerConnection-getStats.https.html.ini | 4 +- .../RTCPeerConnection-getStats.https.html | 43 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/testing/web-platform/meta/webrtc/RTCPeerConnection-getStats.https.html.ini b/testing/web-platform/meta/webrtc/RTCPeerConnection-getStats.https.html.ini index 3405f3ea4426..340f05294a40 100644 --- a/testing/web-platform/meta/webrtc/RTCPeerConnection-getStats.https.html.ini +++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-getStats.https.html.ini @@ -25,11 +25,11 @@ [getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats] expected: FAIL - bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1225720, https://bugzilla.mozilla.org/show_bug.cgi?id=1531094 + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1225720 [getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats] expected: FAIL - bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531094 + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1225723 [getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats] expected: FAIL diff --git a/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html b/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html index 247402b83be0..c2c4e8e37176 100644 --- a/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html +++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html @@ -173,19 +173,18 @@ - All stats objects referenced directly or indirectly by the RTCOutboundRTPStreamStats objects added. */ - promise_test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - return getTrackFromUserMedia('audio') - .then(([track, mediaStream]) => { - pc.addTrack(track, mediaStream); + promise_test(async t => { + const pc = createPeerConnectionWithCleanup(t); + const pc2 = createPeerConnectionWithCleanup(t); - return pc.getStats(track) - .then(statsReport => { - validateStatsReport(statsReport); - assert_stats_report_has_stats(statsReport, ['outbound-rtp']); - }); - }); + let [track, mediaStream] = await getTrackFromUserMedia('audio'); + pc.addTrack(track, mediaStream); + exchangeIceCandidates(pc, pc2); + await doSignalingHandshake(pc, pc2); + await listenToIceConnected(pc); + const stats = await pc.getStats(track); + validateStatsReport(stats); + assert_stats_report_has_stats(stats, ['outbound-rtp']); }, `getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats`); @@ -197,16 +196,20 @@ - All stats objects referenced directly or indirectly by the RTCInboundRTPStreamStats added. */ - promise_test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const transceiver = pc.addTransceiver('audio'); + promise_test(async t => { + const pc = createPeerConnectionWithCleanup(t); + const pc2 = createPeerConnectionWithCleanup(t); - return pc.getStats(transceiver.receiver.track) - .then(statsReport => { - validateStatsReport(statsReport); - assert_stats_report_has_stats(statsReport, ['inbound-rtp']); + let [track, mediaStream] = await getTrackFromUserMedia('audio'); + pc.addTrack(track, mediaStream); + exchangeIceCandidates(pc, pc2); + await doSignalingHandshake(pc, pc2); + await new Promise(resolve => { + pc2.getReceivers()[0].track.addEventListener('unmute', resolve); }); + const stats = await pc2.getStats(track); + validateStatsReport(stats); + assert_stats_report_has_stats(stats, ['inbound-rtp']); }, `getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats`); /*