Bug 1559512: Make sure that we grab the first RTP packet when checking RTP extensions, because the mid extension is only used in the first several. r=jib, a=test-only
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 12 Jul 2019 21:36:16 +0000
changeset 544591 d373c9bd50a4f9f34fdd0be5ad709c26fb461fb5
parent 544590 de4b6c35ab763aecfd79a67ef090ac558875cd57
child 544592 ff3594ae3fe2a4b43791db7e5a921938db50cfbb
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, test-only
bugs1559512
milestone69.0
Bug 1559512: Make sure that we grab the first RTP packet when checking RTP extensions, because the mid extension is only used in the first several. r=jib, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D37884
dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html
dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html
@@ -28,24 +28,26 @@
         pc.mozSetPacketCallback((...args) => {
           res([...args]);
           pc.mozSetPacketCallback(() => {});
           pc.mozDisablePacketDump(0, "rtp", sending);
         })
       );
     }
 
+    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
         // check to make sure each of the received extension ids were in
         // the sdp.
         is(sdpExtmapIds.length, extensions.length, "number of received ids match sdp ids");
         // note, we are comparing a number (from the parsed rtp packet)
         // and a string (from the answer sdp)
--- a/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
@@ -26,23 +26,25 @@
         pc.mozSetPacketCallback((...args) => {
           res([...args]);
           pc.mozSetPacketCallback(() => {});
           pc.mozDisablePacketDump(0, "rtp", sending);
         })
       );
     }
 
+    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
         // the received packet as were negotiated in the sdp.  Then
         // check to make sure each of the received extension ids were in
         // the sdp.
         is(sdpExtmapIds.length, extIds.length,
            `number of sdp ids match received ids ` +