tor-browser

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

RTCPeerConnection-setRemoteDescription-nomsid.html (1472B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>RTCPeerConnection.prototype.setRemoteDescription - legacy streams without a=msid lines</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script>
      7 'use strict';
      8 
      9 const FINGERPRINT_SHA256 = '00:00:00:00:00:00:00:00:00:00:00:00:00' +
     10    ':00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00';
     11 const ICEUFRAG = 'someufrag';
     12 const ICEPWD = 'somelongpwdwithenoughrandomness';
     13 const SDP_BOILERPLATE = 'v=0\r\n' +
     14    'o=- 166855176514521964 2 IN IP4 127.0.0.1\r\n' +
     15    's=-\r\n' +
     16    't=0 0\r\n';
     17 const MINIMAL_AUDIO_MLINE =
     18    'm=audio 9 UDP/TLS/RTP/SAVPF 111\r\n' +
     19    'c=IN IP4 0.0.0.0\r\n' +
     20    'a=rtcp:9 IN IP4 0.0.0.0\r\n' +
     21    'a=ice-ufrag:' + ICEUFRAG + '\r\n' +
     22    'a=ice-pwd:' + ICEPWD + '\r\n' +
     23    'a=fingerprint:sha-256 ' + FINGERPRINT_SHA256 + '\r\n' +
     24    'a=setup:actpass\r\n' +
     25    'a=mid:0\r\n' +
     26    'a=sendrecv\r\n' +
     27    'a=rtcp-mux\r\n' +
     28    'a=rtcp-rsize\r\n' +
     29    'a=rtpmap:111 opus/48000/2\r\n';
     30 
     31  promise_test(async t => {
     32    const pc = new RTCPeerConnection();
     33    t.add_cleanup(() => pc.close());
     34 
     35    const haveOntrack = new Promise(r => pc.ontrack = r);
     36    await pc.setRemoteDescription({type: 'offer', sdp: SDP_BOILERPLATE + MINIMAL_AUDIO_MLINE});
     37    assert_equals((await haveOntrack).streams.length, 1);
     38  }, 'setRemoteDescription with an SDP without a=msid lines triggers ontrack with a default stream.');
     39 
     40 </script>