tor-browser

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

fedcm-button-mode-basics.tentative.https.html (1849B)


      1 <!DOCTYPE html>
      2 <title>Federated Credential Management API Active Mode basic 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 <script type="module">
     10 import {request_options_with_mediation_required,
     11        fedcm_test,
     12        select_manifest,
     13        fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';
     14 
     15 fedcm_test(async t => {
     16  let test_options = request_options_with_mediation_required();
     17  test_options.identity.mode = "active";
     18  await select_manifest(t, test_options);
     19 
     20  let result = navigator.credentials.get(test_options);
     21  return promise_rejects_dom(t, 'NetworkError', result);
     22 }, "Test that the active mode without user activation will fail.");
     23 
     24 fedcm_test(async t => {
     25  let test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
     26  test_options.identity.mode = "active";
     27 
     28  return test_driver.bless('initiate FedCM request', async function() {
     29      let cred = await fedcm_get_and_select_first_account(t, test_options);
     30      assert_equals(cred.token, "mode=active");
     31  });
     32 }, "Test that the active mode succeeds with user activation.");
     33 
     34 fedcm_test(async t => {
     35  let test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
     36  test_options.identity.mode = "active";
     37  test_options.mediation = "silent";
     38 
     39  return test_driver.bless('initiate FedCM request', async function() {
     40      let cred = fedcm_get_and_select_first_account(t, test_options);
     41      let rej = promise_rejects_dom(t, 'NotSupportedError', cred);
     42      await rej;
     43  });
     44 }, "Test that the mediation:silent is not supported in active mode.");
     45 </script>