summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html')
-rw-r--r--testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html
new file mode 100644
index 0000000000..d855e0ad8d
--- /dev/null
+++ b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Federated Credential Management API multi IDP basic success tests.</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,
+ fedcm_get_and_select_first_account,
+ request_options_with_two_idps,
+ manifest_origin,
+ default_manifest_path,
+ fedcm_select_account_promise,
+ alt_manifest_origin} from '../support/fedcm-helper.sub.js';
+
+fedcm_test(async t => {
+ const cred = await fedcm_get_and_select_first_account(t, request_options_with_two_idps());
+ assert_equals(cred.token, "token");
+ assert_equals(cred.configURL, manifest_origin + default_manifest_path);
+}, "Multi IDP FedCM call succeeds when picking the first account.");
+
+fedcm_test(async t => {
+ const promise = navigator.credentials.get(request_options_with_two_idps());
+ // Each IDP has one account, so select the second one.
+ fedcm_select_account_promise(t, 1);
+ const cred = await promise;
+ assert_equals(cred.token, "token");
+ assert_equals(cred.configURL, alt_manifest_origin + default_manifest_path);
+}, "Multi IDP FedCM call succeeds when picking account from the second IDP.");
+</script>