tor-browser

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

fedcm-passive-cannot-replace-active.tentative.https.html (1306B)


      1 <!DOCTYPE html>
      2 <title>Federated Credential Management API Passive Mode Cannot Replace Active Mode.</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        fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';
     13 
     14 fedcm_test(async t => {
     15  let passive_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
     16  let active_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
     17  active_test_options.identity.mode = "active";
     18 
     19  return test_driver.bless('initiate FedCM request', async function() {
     20      let first_cred = fedcm_get_and_select_first_account(t, active_test_options);
     21      let second_cred = navigator.credentials.get(passive_test_options);
     22      let rej = promise_rejects_dom(t, 'NotAllowedError', second_cred);
     23 
     24      let cred = await first_cred;
     25      assert_equals(cred.token, "mode=active");
     26      return rej;
     27  });
     28 }, "Test that the passive mode cannot replace active mode.");
     29 
     30 </script>