tor-browser

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

RTCConfiguration-validation.html (916B)


      1 <!doctype html>
      2 <meta name="timeout" content="long">
      3 <title>RTCConfiguration validation</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="RTCConfiguration-helper.js"></script>
      7 <script src="RTCPeerConnection-helper.js"></script>
      8 <script>
      9  test(() => {
     10    // Check that a configuration change gets applied only if it's entirely valid
     11    // see https://github.com/w3c/webrtc-pc/issues/2688
     12    // and https://github.com/w3c/webrtc-pc/pull/2689
     13    const pc = new RTCPeerConnection();
     14    assert_equals(pc.getConfiguration().iceTransportPolicy, 'all');
     15    assert_throws_dom('SyntaxError', () =>
     16      pc.setConfiguration({iceTransportPolicy: 'relay', iceServers: [{urls: ""}]})
     17    );
     18    assert_equals(pc.getConfiguration().iceTransportPolicy, 'all');
     19  }, `setConfiguration only applies if the entire configuration is valid`);
     20 </script>