diff options
Diffstat (limited to 'testing/web-platform/tests/credential-management/fedcm-multi-idp')
17 files changed, 170 insertions, 457 deletions
diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-first-idp.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-first-idp.https.html deleted file mode 100644 index ed7c1300bd..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-first-idp.https.html +++ /dev/null @@ -1,35 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP abort first IDP test.</title> -<link rel="help" href="https://fedidcg.github.io/FedCM"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<script type="module"> - import { - set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required - } from '../support/fedcm-helper.sub.js'; - - let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - - promise_test(async t => { - let first_controller = new AbortController(); - let first_test_options = request_options_with_mediation_required(); - first_test_options.signal = first_controller.signal; - const first_cred = navigator.credentials.get(first_test_options); - - let second_controller = new AbortController(); - let second_test_options = alt_request_options_with_mediation_required(); - second_test_options.signal = second_controller.signal; - const second_cred = navigator.credentials.get(second_test_options); - - await cookies_promise; - first_controller.abort(); - return Promise.all([ - promise_rejects_dom(t, 'AbortError', first_cred), - promise_rejects_dom(t, 'AbortError', second_cred) - ]); - }, "Test abort signal for a multi IDP request by aborting the first IDP"); -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-second-idp.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-second-idp.https.html deleted file mode 100644 index dfe8969932..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/abort-multiple-gets-through-second-idp.https.html +++ /dev/null @@ -1,35 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP abort second IDP test.</title> -<link rel="help" href="https://fedidcg.github.io/FedCM"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<script type="module"> - import { - set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required - } from '../support/fedcm-helper.sub.js'; - - let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - - promise_test(async t => { - let first_controller = new AbortController(); - let first_test_options = request_options_with_mediation_required(); - first_test_options.signal = first_controller.signal; - const first_cred = navigator.credentials.get(first_test_options); - - let second_controller = new AbortController(); - let second_test_options = alt_request_options_with_mediation_required(); - second_test_options.signal = second_controller.signal; - const second_cred = navigator.credentials.get(second_test_options); - - await cookies_promise; - second_controller.abort(); - return Promise.all([ - promise_rejects_dom(t, 'AbortError', first_cred), - promise_rejects_dom(t, 'AbortError', second_cred) - ]); - }, "Test abort signal for a multi IDP request by aborting the second IDP"); -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-abort.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-abort.https.html new file mode 100644 index 0000000000..712a7b6a34 --- /dev/null +++ b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-abort.https.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<title>Federated Credential Management API multi IDP abort.</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> + +<script type="module"> +import {request_options_with_two_idps, + fedcm_test, + fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js'; + +fedcm_test(async t => { + let controller = new AbortController(); + let test_options = request_options_with_two_idps(); + test_options.signal = controller.signal; + const cred = fedcm_get_and_select_first_account(t, test_options); + controller.abort(); + return promise_rejects_dom(t, 'AbortError', cred); +}, "Test that the abort signal works when multiple IDPs are used."); +</script> 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> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-context.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-context.https.html new file mode 100644 index 0000000000..1bc3eb1f56 --- /dev/null +++ b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-context.https.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<title>Federated Credential Management API multi IDP context 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 {request_options_with_two_idps, + fedcm_get_title_promise, + fedcm_test, + fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; + +fedcm_test(async t => { + const p = navigator.credentials.get(request_options_with_two_idps()); + const result = await fedcm_get_title_promise(t); + assert_true(result.title.toLowerCase().includes('sign in')); + fedcm_select_account_promise(t, 0); + return p; +}, "FedCM multi IDP call defaults to 'signin' context."); + +fedcm_test(async t => { + const options = request_options_with_two_idps(); + options.identity.context = "signup"; + const p = navigator.credentials.get(options); + const result = await fedcm_get_title_promise(t); + assert_true(result.title.toLowerCase().includes('sign up')); + fedcm_select_account_promise(t, 0); + return p; +}, "FedCM multi IDP with non-default context."); +</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-optional.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-optional.https.html new file mode 100644 index 0000000000..1a819efb31 --- /dev/null +++ b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-optional.https.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<title>Federated Credential Management API multi IDP optional mediation 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> + +<script type="module"> +import {request_options_with_two_idps, + fedcm_test, + fedcm_get_and_select_first_account, + fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; + +fedcm_test(async t => { + return fedcm_get_and_select_first_account(t, request_options_with_two_idps('optional')); +}, "Mediation optional can succeed without a returning account."); + +fedcm_test(async t => { + // Sign in to the first account. + await fedcm_get_and_select_first_account(t, request_options_with_two_idps()); + + // Now use mediation:optional and it should work. + return navigator.credentials.get(request_options_with_two_idps('optional')); +}, "Mediation optional automatically succeeds when there is one returning account."); + +fedcm_test(async t => { + // Sign in to the first account. + await fedcm_get_and_select_first_account(t, request_options_with_two_idps()); + + // Sign in to the second account as well. + let cred = navigator.credentials.get(request_options_with_two_idps()); + fedcm_select_account_promise(t, 1); + await cred; + + // Now use mediation:optional. + return fedcm_get_and_select_first_account(t, request_options_with_two_idps('optional')); +}, "Mediation optional can succeed when there is more than one returning account."); +</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-silent.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-silent.https.html new file mode 100644 index 0000000000..d47d4898c7 --- /dev/null +++ b/testing/web-platform/tests/credential-management/fedcm-multi-idp/fedcm-multi-idp-mediation-silent.https.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<title>Federated Credential Management API multi IDP silent mediation 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> + +<script type="module"> +import {request_options_with_two_idps, + fedcm_test, + fedcm_get_and_select_first_account, + fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; + +fedcm_test(async t => { + const cred = navigator.credentials.get(request_options_with_two_idps('silent')); + return promise_rejects_dom(t, 'NetworkError', cred); +}, "Mediation silent fails if there is no returning account."); + +fedcm_test(async t => { + // Sign in to the first account. + await fedcm_get_and_select_first_account(t, request_options_with_two_idps()); + + // Now use mediation:silent and it should work. + return navigator.credentials.get(request_options_with_two_idps('silent')); +}, "Mediation silent succeeds when there is one returning account."); + +fedcm_test(async t => { + // Sign in to the first account. + await fedcm_get_and_select_first_account(t, request_options_with_two_idps()); + + // Sign in to the second account as well. + let cred = navigator.credentials.get(request_options_with_two_idps()); + fedcm_select_account_promise(t, 1); + await cred; + + // Now use mediation:silent and it should fail. + cred = navigator.credentials.get(request_options_with_two_idps('silent')); + return promise_rejects_dom(t, 'NetworkError', cred); +}, "Mediation silent fails when there is more than one returning account."); +</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-after-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-after-onload.https.html deleted file mode 100644 index 12e0eb4d81..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-after-onload.https.html +++ /dev/null @@ -1,47 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP get before and after onload test.</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 {set_fedcm_cookie, set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); -let has_window_loaded = false; -const window_loaded = new Promise(resolve => { - window.addEventListener('load', () => { - has_window_loaded = true; - resolve(); - }); -}); - -promise_test(async t => { - let first_cred_resolved = false; - assert_false(has_window_loaded); - // First navigator.credentials.get() is called prior to window.onload - const first_cred = navigator.credentials.get(request_options_with_mediation_required()).finally(() => { first_cred_resolved = true; }); - await Promise.all([cookies_promise, window_loaded]); - assert_true(has_window_loaded); - assert_false(first_cred_resolved); - - // Second navigator.credentials.get() is called after window.onload but before first navigator.credentials.get() - // resolves. Should be rejected because it occurs after onload, and the first get() call is pending. - const second_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - const rejection = promise_rejects_dom(t, 'NotAllowedError', second_cred); - - // Select first account from the first get() call. - await fedcm_select_account_promise(t, 0); - const first = await first_cred; - assert_equals(first.token, "token"); - return rejection; -}, "When there's a `get` call before onload, a `get` call which occurs after onload but before the first `get` call resolves, should be rejected."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-during-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-during-onload.https.html deleted file mode 100644 index 3e2f134f20..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-and-during-onload.https.html +++ /dev/null @@ -1,42 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP get before and during onload test.</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 {set_fedcm_cookie, set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - -promise_test(async t => { - let has_window_loaded = false; - let rejection; - const window_loaded = new Promise(resolve => { - window.addEventListener('load', async () => { - const second_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - rejection = promise_rejects_dom(t, 'NetworkError', second_cred); - has_window_loaded = true; - resolve(); - }); - }); - assert_false(has_window_loaded); - const first_cred = navigator.credentials.get(request_options_with_mediation_required()); - await Promise.all([cookies_promise, window_loaded]); - - // Select first account from the first get() call. - await fedcm_select_account_promise(t, 0); - assert_true(has_window_loaded); - const first = await first_cred; - assert_equals(first.token, "token"); - return rejection; -}, "A `get` call before onload and a `get` call during onload should be combined."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-onload-and-during-dom-content-loaded.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-onload-and-during-dom-content-loaded.https.html deleted file mode 100644 index 95495948b7..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/get-before-onload-and-during-dom-content-loaded.https.html +++ /dev/null @@ -1,42 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP get before onload and during DOMContentLoaded test.</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 {set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - -promise_test(async t => { - let has_dom_content_loaded = false; - let rejection; - const dom_content_loaded = new Promise(resolve => { - document.addEventListener('DOMContentLoaded', async () => { - const second_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - rejection = promise_rejects_dom(t, 'NetworkError', second_cred); - has_dom_content_loaded = true; - resolve(); - }); - }); - assert_false(has_dom_content_loaded); - const first_cred = navigator.credentials.get(request_options_with_mediation_required()); - await Promise.all([cookies_promise, dom_content_loaded]); - assert_true(has_dom_content_loaded); - - await fedcm_select_account_promise(t, 0); - const first = await first_cred; - assert_equals(first.token, "token"); - return rejection; -}, "A `get` call before onload and a `get` call during DOMContentLoaded event should combine despite being called from different tasks."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-abort.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-abort.https.html deleted file mode 100644 index 899302fb22..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-abort.https.html +++ /dev/null @@ -1,49 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP get after abort test.</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> - -<script type="module"> - import { - set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise - } from '../support/fedcm-helper.sub.js'; - - let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - - promise_test(async t => { - let first_controller = new AbortController(); - let first_test_options = request_options_with_mediation_required(); - first_test_options.signal = first_controller.signal; - const first_cred = navigator.credentials.get(first_test_options); - - let second_controller = new AbortController(); - let second_test_options = alt_request_options_with_mediation_required(); - second_test_options.signal = second_controller.signal; - const second_cred = navigator.credentials.get(second_test_options); - - await cookies_promise; - second_controller.abort(); - await Promise.all([ - promise_rejects_dom(t, 'AbortError', first_cred), - promise_rejects_dom(t, 'AbortError', second_cred) - ]); - - const third_cred = navigator.credentials.get(request_options_with_mediation_required()); - const fourth_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - - // Select first account, i.e. from the `third_cred`. - await fedcm_select_account_promise(t, 0); - - // NetworkError is returned when another IDP is selected. - await promise_rejects_dom(t, 'NetworkError', fourth_cred); - const cred = await third_cred; - assert_equals(cred.token, "token"); - }, "Multiple gets after aborting a multi IDP request should work"); -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-onload.https.html deleted file mode 100644 index 1b5d744e8f..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-after-onload.https.html +++ /dev/null @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP multiple gets after onload test.</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 {set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); -const window_loaded = new Promise(resolve => { - window.addEventListener('load', () => { - resolve(); - }); -}); - -promise_test(async t => { - await Promise.all([cookies_promise, window_loaded]); - const first_cred = navigator.credentials.get(request_options_with_mediation_required()); - const second_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - - // Select first account from the first get() call. - await fedcm_select_account_promise(t, 0); - // NetworkError is returned when another IDP is selected. - await promise_rejects_dom(t, 'NetworkError', second_cred); - const first = await first_cred; - assert_equals(first.token, "token"); -}, "No `get` calls before or during onload, multiple `get` calls after onload in the same task are allowed."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-before-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-before-onload.https.html deleted file mode 100644 index 8c98bf53b0..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-before-onload.https.html +++ /dev/null @@ -1,37 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP multiple gets before onload test.</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 {set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); -let has_window_loaded = false; -window.addEventListener('load', () => { - has_window_loaded = true; -}); - -promise_test(async t => { - assert_false(has_window_loaded); - const first_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - const second_cred = navigator.credentials.get(request_options_with_mediation_required()); - await cookies_promise; - - // Select second account, i.e. from the second get() call. - await fedcm_select_account_promise(t, 1); - await promise_rejects_dom(t, 'NetworkError', first_cred); - const cred = await second_cred; - assert_equals(cred.token, "token"); -}, "Multiple get calls before window onload are allowed."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-during-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-during-onload.https.html deleted file mode 100644 index bcf70a31c7..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/multiple-gets-during-onload.https.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP multiple gets during onload test.</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 {set_fedcm_cookie, - set_alt_fedcm_cookie, - request_options_with_mediation_required, - alt_request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let cookies_promise = Promise.all([set_fedcm_cookie(), set_alt_fedcm_cookie()]); - -promise_test(async t => { - const window_loaded = new Promise(resolve => { - window.addEventListener('load', async () => { - const first_cred = navigator.credentials.get(request_options_with_mediation_required()); - const second_cred = navigator.credentials.get(alt_request_options_with_mediation_required()); - await cookies_promise; - await fedcm_select_account_promise(t, 0); - await promise_rejects_dom(t, 'NetworkError', second_cred); - const first = await first_cred; - assert_equals(first.token, "token"); - resolve(); - }); - }); - await window_loaded; -}, "No `get` calls before onload, multiple `get` calls during onload are allowed."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-after-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-after-onload.https.html deleted file mode 100644 index de6a7c5371..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-after-onload.https.html +++ /dev/null @@ -1,29 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP single get after onload test.</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 {set_fedcm_cookie, - request_options_with_mediation_required, - fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js'; - -const window_loaded = new Promise(resolve => { - window.addEventListener('load', () => { - resolve(); - }); -}); - -promise_test(async t => { - await set_fedcm_cookie(); - await window_loaded; - const cred = await fedcm_get_and_select_first_account(t, request_options_with_mediation_required()); - assert_equals(cred.token, "token"); -}, "Single `get` call after onload is allowed."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-before-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-before-onload.https.html deleted file mode 100644 index 0ac9b0e920..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-before-onload.https.html +++ /dev/null @@ -1,37 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP single get before onload test.</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 {set_fedcm_cookie, - request_options_with_mediation_required, - fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; - -let has_window_loaded = false; -const window_loaded = new Promise(resolve => { - window.addEventListener('load', () => { - has_window_loaded = true; - resolve(); - }); -}); - -promise_test(async t => { - const first_cred = navigator.credentials.get(request_options_with_mediation_required()); - assert_false(has_window_loaded); - await set_fedcm_cookie(); - await window_loaded; - assert_true(has_window_loaded); - - // Select first account after onload. - await fedcm_select_account_promise(t, 0); - const first = await first_cred; - assert_equals(first.token, "token"); -}, "Single `get` call before onload is allowed even if account is selected after."); - -</script> diff --git a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-during-onload.https.html b/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-during-onload.https.html deleted file mode 100644 index 832565744d..0000000000 --- a/testing/web-platform/tests/credential-management/fedcm-multi-idp/single-get-during-onload.https.html +++ /dev/null @@ -1,30 +0,0 @@ -<!DOCTYPE html> -<title>Federated Credential Management API multi IDP single get during onload test.</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 {request_options_with_mediation_required, - set_fedcm_cookie, - fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js'; - -promise_test(async t => { - const window_loaded = new Promise(resolve => { - window.addEventListener('load', async () => { - await set_fedcm_cookie(); - const first_cred = fedcm_get_and_select_first_account(t, - request_options_with_mediation_required()); - const cred = await first_cred; - assert_equals(cred.token, "token"); - resolve(); - }); - }); - await window_loaded; -}, "Single `get` call during onload is allowed."); - -</script> |