Bug 1337468: enabled RID RTP header extensions in simulcast test draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 07 Feb 2017 14:57:33 -0800
changeset 481052 ecb6ae0a1a53237ebf37ff78797787a1c754a240
parent 479044 3e555770a90a41e04bbb4ac41b65fa2f1db6977d
child 481053 62a1f7b4ebce214f0d88965f8226decb2086ed08
push id44700
push userdrno@ohlmeier.org
push dateThu, 09 Feb 2017 05:38:26 +0000
bugs1337468
milestone54.0a1
Bug 1337468: enabled RID RTP header extensions in simulcast test MozReview-Commit-ID: BugPs8YA6tY
dom/media/tests/mochitest/sdpUtils.js
dom/media/tests/mochitest/test_peerConnection_simulcastOffer.html
--- a/dom/media/tests/mochitest/sdpUtils.js
+++ b/dom/media/tests/mochitest/sdpUtils.js
@@ -60,22 +60,26 @@ removeAllRtpMaps: function(sdp) {
 reduceAudioMLineToDynamicPtAndOpus: function(sdp) {
   return sdp.replace(/m=audio .*\r\n/g, "m=audio 9 UDP/TLS/RTP/SAVPF 101 109\r\n");
 },
 
 transferSimulcastProperties: function(offer_sdp, answer_sdp) {
   if (!offer_sdp.includes("a=simulcast:")) {
     return answer_sdp;
   }
+  ok(offer_sdp.includes("a=simulcast: send rid"), "Offer contains simulcast attribute");
   var o_simul = offer_sdp.match(/simulcast: send rid=(.*)([\n$])*/i);
+  var new_answer_sdp = answer_sdp + "a=simulcast: recv rid=" + o_simul[1] + "\r\n";
+  ok(offer_sdp.includes("a=rid:"), "Offer contains RID attribute");
   var o_rids = offer_sdp.match(/a=rid:(.*)/ig);
-  var new_answer_sdp = answer_sdp + "a=simulcast: recv rid=" + o_simul[1] + "\r\n";
   o_rids.forEach((o_rid) => {
     new_answer_sdp = new_answer_sdp + o_rid.replace(/send/, "recv") + "\r\n";
   });
+  ok(offer_sdp.includes("a=extmap:1/sendonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"), "Offer contains RID RTP header extension");
+  new_answer_sdp = new_answer_sdp + "a=extmap:1/recvonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n";
   return new_answer_sdp;
 },
 
 verifySdp: function(desc, expectedType, offerConstraintsList, offerOptions,
                     testOptions) {
   info("Examining this SessionDescription: " + JSON.stringify(desc));
   info("offerConstraintsList: " + JSON.stringify(offerConstraintsList));
   info("offerOptions: " + JSON.stringify(offerOptions));
--- a/dom/media/tests/mochitest/test_peerConnection_simulcastOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_simulcastOffer.html
@@ -57,16 +57,17 @@
       test.chain.insertAfter('PC_LOCAL_GET_ANSWER', [
         function PC_LOCAL_ADD_RIDS_TO_ANSWER(test) {
           test._remote_answer.sdp = sdputils.transferSimulcastProperties(
             test.originalOffer.sdp, test._remote_answer.sdp);
           info("Answer with RIDs: " + JSON.stringify(test._remote_answer));
           ok(test._remote_answer.sdp.match(/a=simulcast:/), "Modified answer has simulcast");
           ok(test._remote_answer.sdp.match(/a=rid:foo/), "Modified answer has rid foo");
           ok(test._remote_answer.sdp.match(/a=rid:bar/), "Modified answer has rid bar");
+          ok(test._remote_answer.sdp.match(/urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id/), "Modified answer has RID");
         }
       ]);
 
       test.chain.insertAfter('PC_REMOTE_WAIT_FOR_MEDIA_FLOW',[
         function PC_REMOTE_SET_RTP_FIRST_RID(test) {
           // Cause pcRemote to filter out everything but the first SSRC. This
           // lets only one of the simulcast streams through.
           selectRecvSsrc(test.pcRemote, 0);