tor-browser

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

fedcm-single-identifier.https.html (1356B)


      1 <!DOCTYPE html>
      2 <title>Federated Credential Management API alternative identifier 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 {fedcm_test,
     13        request_options_with_mediation_required,
     14        select_manifest,
     15        fedcm_get_dialog_type_promise,
     16        fedcm_select_account_promise} from '../support/fedcm-helper.sub.js';
     17 
     18 fedcm_test(async t => {
     19  let test_options = request_options_with_mediation_required("manifest_with_single_identifier.json");
     20  await select_manifest(t, test_options);
     21 
     22  const cred_promise = navigator.credentials.get(test_options);
     23 
     24  // Wait for the dialog to appear.
     25  const type = await fedcm_get_dialog_type_promise(t);
     26  assert_equals(type, "AccountChooser");
     27 
     28  const accounts = await window.test_driver.get_fedcm_account_list();
     29  assert_equals(accounts.length, 2);
     30 
     31  fedcm_select_account_promise(t, 0);
     32 
     33  const cred = await cred_promise;
     34  assert_equals(cred.token, "account_id=john_doe");
     35  assert_equals(cred.isAutoSelected, false);
     36 }, "Accounts that only have a phone number or only a username should not cause failure.");
     37 
     38 </script>