tor-browser

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

fedcm-identity-assertion-nocors.https.html (1234B)


      1 <!DOCTYPE html>
      2 <title>Federated Credential Management API test with no CORS identity assertion.</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 <script type="module">
     10 import {alt_request_options_with_mediation_required,
     11        fedcm_test,
     12        select_manifest,
     13        fedcm_error_dialog_dismiss,
     14        fedcm_select_account_promise} from './support/fedcm-helper.sub.js';
     15 
     16 fedcm_test(async t => {
     17  let test_options = alt_request_options_with_mediation_required("manifest-token-nocors.json");
     18  await select_manifest(t, test_options);
     19  try {
     20    const cred_promise = navigator.credentials.get(test_options);
     21    await fedcm_select_account_promise(t, 0);
     22    fedcm_error_dialog_dismiss(t);
     23    await cred_promise;
     24    assert_unreached("An IdentityCredentialError exception should be thrown.");
     25  } catch (e) {
     26    assert_true(e instanceof DOMException);
     27    assert_equals(e.name, "IdentityCredentialError");
     28  }
     29 }, 'Test that promise is rejected if identity assertion does not use CORS');
     30 </script>