summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html')
-rw-r--r--testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html b/testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html
new file mode 100644
index 0000000000..cb5dfa615f
--- /dev/null
+++ b/testing/web-platform/tests/credential-management/fedcm-too-many-disconnect-calls.https.html
@@ -0,0 +1,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>