tor-browser

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

RTCPeerConnection-getTransceivers.html (1301B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>RTCPeerConnection.prototype.getTransceivers</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script>
      7  'use strict';
      8 
      9  // Test is based on the following editor draft:
     10  // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
     11 
     12  /*
     13   *  5.1. RTCPeerConnection Interface Extensions
     14   *  partial interface RTCPeerConnection {
     15   *      sequence<RTCRtpSender>      getSenders();
     16   *      sequence<RTCRtpReceiver>    getReceivers();
     17   *      sequence<RTCRtpTransceiver> getTransceivers();
     18   *      ...
     19   *  };
     20   */
     21 
     22  test(t => {
     23    const pc = new RTCPeerConnection();
     24 
     25    assert_idl_attribute(pc, 'getSenders');
     26    const senders = pc.getSenders();
     27    assert_array_equals([], senders, 'Expect senders to be empty array');
     28 
     29    assert_idl_attribute(pc, 'getReceivers');
     30    const receivers = pc.getReceivers();
     31    assert_array_equals([], receivers, 'Expect receivers to be empty array');
     32 
     33    assert_idl_attribute(pc, 'getTransceivers');
     34    const transceivers = pc.getTransceivers();
     35    assert_array_equals([], transceivers, 'Expect transceivers to be empty array');
     36 
     37  }, 'Initial peer connection should have list of zero senders, receivers and transceivers');
     38 
     39 </script>