2 <title>Federated Credential Management API network request tests.
</title>
3 <link rel=
"help" href=
"https://fedidcg.github.io/FedCM">
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
10 import {set_fedcm_cookie} from './support/fedcm-helper.js';
12 const url_prefix = 'https://{{host}}:{{ports[https][
0]}}/credential-management/support/';
13 promise_test(async t =
> {
14 await set_fedcm_cookie();
15 const result = await navigator.credentials.get({
23 const token = await result.login({nonce: '
1'});
24 assert_equals(token.idToken, 'token');
25 }, 'Test that COEP policy do not apply to FedCM requests');
27 promise_test(async t =
> {
28 await set_fedcm_cookie();
29 const result = await navigator.credentials.get({
32 url: url_prefix +
"fedcm-manifest-not-in-list/",
37 return promise_rejects_dom(t, 'NetworkError', result.login({nonce: '
1'}));
38 }, 'Test that the promise is rejected if the manifest is not in the manifest list');