tor-browser

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

RTCPeerConnection-plan-b-is-not-supported.html (920B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <meta name="timeout" content="long">
      4 <title></title>
      5 <script src=/resources/testharness.js></script>
      6 <script src=/resources/testharnessreport.js></script>
      7 <script>
      8 'use strict';
      9 
     10 promise_test(async t => {
     11  // Plan B is a legacy feature that should not be supported on a modern
     12  // browser. To pass this test you must either ignore sdpSemantics altogether
     13  // (and construct with Unified Plan despite us asking for Plan B) or throw an
     14  // exception.
     15  let pc = null;
     16  try {
     17    pc = new RTCPeerConnection({sdpSemantics:"plan-b"});
     18    t.add_cleanup(() => pc.close());
     19  } catch (e) {
     20    // Test passed!
     21    return;
     22  }
     23  // If we did not throw, we must not have gotten what we asked for. If
     24  // sdpSemantics is not recognized by the browser it will be undefined here.
     25  assert_not_equals(pc.getConfiguration().sdpSemantics, "plan-b");
     26 }, 'Plan B is not supported');
     27 
     28 </script>