tor-browser

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

fedcm-opaque-rp-origin.https.html (1074B)


      1 <!DOCTYPE html>
      2 <title>Federated Credential Management API network request tests.</title>
      3 <link rel="help" href="https://fedidcg.github.io/FedCM">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 
      9 <body>
     10 
     11 <script type="module">
     12 import {alt_request_options_with_mediation_required,
     13        set_alt_fedcm_cookie} from './support/fedcm-helper.sub.js';
     14 
     15 // We do not use fedcm_test, because that tries to set document.cookie
     16 // via set_fedcm_cookie, which is not allowed in a sandboxed document.
     17 promise_test(async t => {
     18  // This test uses a `Content-Security-Policy: sandbox allow-scripts` header
     19  // to trigger an opaque origin.
     20  assert_equals(window.origin, 'null');
     21  await set_alt_fedcm_cookie();
     22  const cred = navigator.credentials.get(alt_request_options_with_mediation_required());
     23  return promise_rejects_dom(t, 'NetworkError', cred);
     24 }, "Opaque RP origin should trigger a NetworkError.");
     25 
     26 </script>