tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_peerConnection_verifyNonEmptyFmtp.html (1416B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <script type="application/javascript" src="pc.js"></script>
      5 </head>
      6 <body>
      7 <pre id="test">
      8 <script type="application/javascript">
      9  createHTML({
     10    bug: "1933728",
     11    title: "Verify SDP FMTP is non-empty"
     12  });
     13 
     14  var test;
     15  runNetworkTest(async function (options) {
     16    await pushPrefs(["media.webrtc.codec.video.av1.enabled", true]);
     17 
     18    test = new PeerConnectionTest(options);
     19    test.setMediaConstraints([{audio: true}, {video: true}],
     20                             [{audio: true}, {video: true}]);
     21 
     22    const checkFmtp = sdp => {
     23      sdp.split("\r\n").forEach(line => {
     24        if (line.startsWith("a=fmtp:")) {
     25          let parts = line.split(" ");
     26          parts.forEach(token => {
     27            ok(token.length, `FMTP parameter "${token}" in line "${line}" is non-empty`);
     28          });
     29        }
     30      });
     31    };
     32 
     33    test.chain.insertAfter('PC_LOCAL_SET_LOCAL_DESCRIPTION', [
     34      async function PC_LOCAL_CHECK_SDP_OFFER_FMTP() {
     35        info("Checking FMTP parameters in offer SDP");
     36        checkFmtp(test.originalOffer.sdp);
     37      },
     38    ]);
     39 
     40    test.chain.removeAfter('PC_REMOTE_SET_LOCAL_DESCRIPTION');
     41    test.chain.append([
     42      async function PC_LOCAL_CHECK_SDP_ANSWER_FMTP() {
     43        info("Checking FMTP parameters in answer SDP");
     44        checkFmtp(test.originalAnswer.sdp);
     45      }
     46    ]);
     47 
     48    await test.run();
     49  });
     50 </script>
     51 </pre>
     52 </body>
     53 </html>