diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html index 56b17fd8d311..d5c28eedf3a1 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html @@ -33,14 +33,16 @@ ); } + const pc = SpecialPowers.wrap(test.pcRemote._pc); + const haveFirstPacket = getRtpPacket(pc); + test.chain.insertBefore('PC_REMOTE_WAIT_FOR_MEDIA_FLOW', [ async function PC_REMOTE_CHECK_RTP_HEADER_EXTS_AGAINST_SDP() { const sdpExtmapIds = sdputils.findExtmapIds(test.originalAnswer.sdp); - let pc = SpecialPowers.wrap(test.pcRemote._pc); - let [level, type, sending, data] = await getRtpPacket(pc); - let extensions = ParseRtpPacket(data).header.extensions; + const [level, type, sending, data] = await haveFirstPacket; + const extensions = ParseRtpPacket(data).header.extensions; // make sure we got the same number of rtp header extensions in // the received packet as were negotiated in the sdp. Then diff --git a/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html b/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html index 1c87e4dd87bc..503f85ad2080 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html @@ -31,13 +31,15 @@ ); } + const pc = SpecialPowers.wrap(test.pcRemote._pc); + const haveFirstPacket = getRtpPacket(pc); + test.chain.insertBefore('PC_REMOTE_WAIT_FOR_MEDIA_FLOW', [ async function PC_REMOTE_CHECK_RTP_HEADER_EXTS_AGAINST_SDP() { const sdpExtmapIds = sdputils.findExtmapIds(test.originalAnswer.sdp); - const pc = SpecialPowers.wrap(test.pcRemote._pc); - const [level, type, sending, data] = await getRtpPacket(pc); + const [level, type, sending, data] = await haveFirstPacket; const packet = ParseRtpPacket(data); const extIds = packet.header.extensions.map(e => `${e.id}`); // make sure we got the same number of rtp header extensions in