summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-basic.https.html
diff options
context:
space:
mode:
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>