diff options
Diffstat (limited to 'testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html')
-rw-r--r-- | testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html b/testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html index bfa82b979c..2fcf33dc2e 100644 --- a/testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html +++ b/testing/web-platform/tests/webrtc/RTCRtpReceiver-getStats.https.html @@ -23,8 +23,8 @@ exchangeIceCandidates(caller, callee); await exchangeOfferAnswer(caller, callee); - // Wait for RTP - await new Promise(r => receiver.track.onunmute = r); + await listenToConnected(callee); + await waitForTrackUnmuted(receiver.track); const statsReport = await receiver.getStats(); assert_true(!![...statsReport.values()].find(({type}) => type === 'inbound-rtp')); }, 'receiver.getStats() via addTransceiver should return stats report containing inbound-rtp stats'); @@ -42,8 +42,8 @@ exchangeIceCandidates(caller, callee); await exchangeOfferAnswer(caller, callee); const receiver = callee.getReceivers()[0]; - // Wait for RTP - await new Promise(r => receiver.track.onunmute = r); + await listenToConnected(callee); + await waitForTrackUnmuted(receiver.track); const statsReport = await receiver.getStats(); assert_true(!![...statsReport.values()].find(({type}) => type === 'inbound-rtp')); }, 'receiver.getStats() via addTrack should return stats report containing inbound-rtp stats'); @@ -61,8 +61,8 @@ exchangeIceCandidates(caller, callee); await exchangeOfferAnswer(caller, callee); const [receiver] = callee.getReceivers(); - // Wait for RTP - await new Promise(r => receiver.track.onunmute = r); + await listenToConnected(callee); + await waitForTrackUnmuted(receiver.track); const [transceiver] = callee.getTransceivers(); const statsPromiseFirst = receiver.getStats(); transceiver.stop(); @@ -85,8 +85,8 @@ exchangeIceCandidates(caller, callee); await exchangeOfferAnswer(caller, callee); const [receiver] = callee.getReceivers(); - // Wait for RTP - await new Promise(r => receiver.track.onunmute = r); + await listenToConnected(callee); + await waitForTrackUnmuted(receiver.track); const statsReportFirst = await receiver.getStats(); callee.close(); const statsReportSecond = await receiver.getStats(); @@ -107,8 +107,8 @@ exchangeIceCandidates(caller, callee); await exchangeOfferAnswer(caller, callee); const receiver = callee.getReceivers()[0]; - // Wait for RTP - await new Promise(r => receiver.track.onunmute = r); + await listenToConnected(callee); + await waitForTrackUnmuted(receiver.track); const statsReport = await receiver.getStats(); assert_true(!![...statsReport.values()].find(({type}) => type === 'candidate-pair')); assert_true(!![...statsReport.values()].find(({type}) => type === 'local-candidate')); |