Bug 1551361 - add extra logging to basic RTP extensions test - r=bwc
authorNico Grunbaum <na-g@nostrum.com>
Tue, 14 May 2019 22:21:58 +0000
changeset 532714 556e4f98beeb3442f8d588be05ae6afdaff44d13
parent 532713 2c73bd0fae85c2e877932e9f98ffd28fe91538f1
child 532715 af0fd51dc41a2c7e0271a932079ac4652d5f5b03
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1551361
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551361 - add extra logging to basic RTP extensions test - r=bwc Differential Revision: https://phabricator.services.mozilla.com/D31106
dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
--- a/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicVideoVerifyRtpHeaderExtensions.html
@@ -31,28 +31,34 @@
       );
     }
 
     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 pc = SpecialPowers.wrap(test.pcRemote._pc);
+        const [level, type, sending, data] =  await getRtpPacket(pc);
+        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, extensions.length, "number of received ids match sdp ids");
+        is(sdpExtmapIds.length, extIds.length,
+           `number of sdp ids match received ids ` +
+           `${JSON.stringify(sdpExtmapIds)} == ${JSON.stringify(extIds)}\n` +
+           `sdp = ${test.originalAnswer.sdp}\n` +
+           `packet = ${JSON.stringify(packet, null, 2)}`);
         // note, we are comparing a number (from the parsed rtp packet)
         // and a string (from the answer sdp)
-        ok(extensions.every((ext) => sdpExtmapIds.includes(""+ext.id)), "extension id arrays equivalent");
+        ok(extIds.every(id => sdpExtmapIds.includes(id)) &&
+           sdpExtmapIds.every(id => extIds.includes(id)),
+          `extension id arrays equivalent`);
       }
     ]);
 
     test.run();
   });
 </script>
 </pre>
 </body>