DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (b6d82b1a6b02)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
<!DOCTYPE HTML>
<html>
<head>
  <script type="application/javascript" src="pc.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
  createHTML({
    bug: "1406529",
    title: "Verify SDP extmap attribute for sendonly connection"
  });

  var test;
  runNetworkTest(function (options) {
    test = new PeerConnectionTest(options);
    test.setMediaConstraints([{audio: true}, {video: true}],
                             []);

    test.chain.insertAfter('PC_LOCAL_SET_LOCAL_DESCRIPTION', [
      async function PC_LOCAL_CHECK_SDP_OFFER_EXTMAP() {
        sdputils.verify_unique_extmap_ids(test.originalOffer.sdp);

        const audio = sdputils.findExtmapIdsUrnsDirections(
            sdputils.getAudioMSections(test.originalOffer.sdp));
        const expected_audio = [
          /* Please modify this list when you add or remove RTP header
          extensions. */
          ["1", "urn:ietf:params:rtp-hdrext:ssrc-audio-level", ""],
          ["2", "urn:ietf:params:rtp-hdrext:csrc-audio-level", "recvonly"],
          ["3", "urn:ietf:params:rtp-hdrext:sdes:mid", ""],
        ];
        // *Ugh* ...
        ok(JSON.stringify(audio) ===
           JSON.stringify(expected_audio),
           "List of offer audio URNs meets expected values");

        const video = sdputils.findExtmapIdsUrnsDirections(
            sdputils.getVideoMSections(test.originalOffer.sdp));
        const expected_video = [
          /* Please modify this list when you add or remove RTP header
          extensions. */
          ["3", "urn:ietf:params:rtp-hdrext:sdes:mid", ""],
          ["4", "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", ""],
          ["5", "urn:ietf:params:rtp-hdrext:toffset", ""],
        ];
        // *Ugh* ...
        ok(JSON.stringify(video) ===
           JSON.stringify(expected_video),
           "List of offer video URNs meets expected values");
      }
    ]);

    test.chain.removeAfter('PC_REMOTE_SET_LOCAL_DESCRIPTION');
    test.chain.append([
      async function PC_REMOTE_CHECK_SDP_ANSWER_EXTMAP() {
        sdputils.verify_unique_extmap_ids(test.originalAnswer.sdp);

        const audio = sdputils.findExtmapIdsUrnsDirections(
            sdputils.getAudioMSections(test.originalAnswer.sdp));
        const expected_audio = [
          /* Please modify this list when you add or remove RTP header
          extensions. */
          ["1", "urn:ietf:params:rtp-hdrext:ssrc-audio-level",""],
          ["3", "urn:ietf:params:rtp-hdrext:sdes:mid",""],
        ];
        // *Ugh* ...
        ok(JSON.stringify(audio) ===
           JSON.stringify(expected_audio),
           "List of answer audio URNs meets expected values");

        const video = sdputils.findExtmapIdsUrnsDirections(
            sdputils.getVideoMSections(test.originalAnswer.sdp));
        const expected_video = [
          /* Please modify this list when you add or remove RTP header
          extensions. */
          ["3", "urn:ietf:params:rtp-hdrext:sdes:mid",""],
          ["4", "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",""],
          ["5", "urn:ietf:params:rtp-hdrext:toffset",""],
        ];
        ok(JSON.stringify(video) ===
           JSON.stringify(expected_video),
           "List of answer video URNs meets expected values");
      }
    ]);

    test.run();
  });
</script>
</pre>
</body>
</html>