tor-browser

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

webrtc-peer-connection.https.html (1314B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="/common/dispatcher/dispatcher.js"></script>
      6 <script src="/common/get-host-info.sub.js"></script>
      7 <script src="resources/utils.js"></script>
      8 <title>Test that RTCPeerConnection construction fails in a fenced frame.</title>
      9 
     10 <body>
     11  <script>
     12    promise_test(async (t) => {
     13      let fencedframe = attachFencedFrameContext();
     14      return fencedframe.execute(() => {
     15        try {
     16          // Copied from https://webrtc.org/getting-started/peer-connections.
     17          // The contents of the configuration object doesn't matter here,
     18          // because construction should fail before the information becomes
     19          // relevant.
     20          const configuration = {
     21            'iceServers': [{'urls': 'stun:stun.example.com:19302'}]
     22          };
     23          const peerConnection = new RTCPeerConnection(configuration);
     24          assert_unreached("RTCPeerConnection construction should fail in a " +
     25                           "fenced frame");
     26        } catch (err) {
     27          assert_equals(err.name, "NotAllowedError");
     28        }
     29      });
     30    }, "Test that RTCPeerConnection construction fails in a fenced frame.");
     31 
     32  </script>
     33 </body>