summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html
blob: cb5dfa615f34bc7de4ecdd9ab4c4a11b3ce0eb2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<title>Federated Credential Management API two disconnect() at the same time.</title>
<link rel="help" href="https://fedidcg.github.io/FedCM">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<body>

<script type="module">
import {fedcm_test,
        mark_signed_in,
        set_fedcm_cookie,
        fedcm_get_and_select_first_account,
        manifest_origin,
        request_options_with_mediation_required,
        disconnect_options} from './support/fedcm-helper.sub.js';

fedcm_test(async t => {
  await mark_signed_in();
  await set_fedcm_cookie();
  // Get at least one connected account that can be disconnected.
  const cred = await fedcm_get_and_select_first_account(t, request_options_with_mediation_required());
  const manifest = `${manifest_origin}/\
credential-management/support/fedcm/manifest.py`;
  const options = disconnect_options("1234");
  IdentityCredential.disconnect(options);
  await promise_rejects_dom(t, 'NetworkError', IdentityCredential.disconnect(options));
}, "When disconnect is called while there is a pending one, it is rejected.");
</script>