forked from kdashg/gecko-cinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1847323 [wpt PR 41346] - [FedCM] Split fedcm-network-requests.htt…
…ps.html into multiple files, a=testonly Automatic update from web-platform-tests [FedCM] Split fedcm-network-requests.https.html into multiple files The test is currently flaky timeout so we split into multiple files in order to determine which one(s) timeout. Also, the auto reauthn test is fixed to actually test reauthn. Bug: 1404951 Change-Id: I40eff5d39652369ee0b98c438c553987c4efd5eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4753833 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/main@{#1179752} -- wpt-commits: 20bae55a19dd614fba324d2d352954ad8311eb48 wpt-pr: 41346
- Loading branch information
1 parent
2d5dba8
commit 3c7c661
Showing
12 changed files
with
342 additions
and
210 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
testing/web-platform/tests/credential-management/fedcm-abort.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
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_mediation_required(); | ||
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 the abort signal"); | ||
</script> |
25 changes: 25 additions & 0 deletions
25
testing/web-platform/tests/credential-management/fedcm-after-abort.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
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_mediation_required(); | ||
test_options.signal = controller.signal; | ||
const first_cred = fedcm_get_and_select_first_account(t, test_options); | ||
controller.abort(); | ||
await promise_rejects_dom(t, 'AbortError', first_cred); | ||
|
||
const second_cred = await fedcm_get_and_select_first_account(t, request_options_with_mediation_required()); | ||
assert_equals(second_cred.token, "token"); | ||
}, "Get after abort should work"); | ||
</script> |
21 changes: 21 additions & 0 deletions
21
testing/web-platform/tests/credential-management/fedcm-basic.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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, | ||
request_options_with_mediation_required, | ||
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
const cred = await fedcm_get_and_select_first_account(t, request_options_with_mediation_required()); | ||
assert_equals(cred.token, "token"); | ||
}, "Successfully obtaining token should resolve the promise."); | ||
|
||
</script> |
41 changes: 41 additions & 0 deletions
41
testing/web-platform/tests/credential-management/fedcm-client-metadata-not-cached.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
fedcm_test, | ||
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
// Reset the client_metadata fetch count. | ||
const clear_metadata_count_path = `support/fedcm/client_metadata_clear_count.py`; | ||
await fetch(clear_metadata_count_path); | ||
|
||
// FedCM flow causes the counter of client metadata to increase by 1. | ||
const cred = await fedcm_get_and_select_first_account(t, request_options_with_mediation_required()); | ||
assert_equals(cred.token, "token"); | ||
|
||
await new Promise(resolve => { | ||
// Fetch the client metadata from a popup window. | ||
let popup_window = window.open('support/fedcm/client_metadata.py?skip_checks=1'); | ||
const popup_window_load_handler = (event) => { | ||
popup_window.removeEventListener('load', popup_window_load_handler); | ||
popup_window.close(); | ||
resolve(); | ||
}; | ||
popup_window.addEventListener('load', popup_window_load_handler); | ||
}); | ||
|
||
const client_metadata_counter = await fetch(clear_metadata_count_path); | ||
const client_metadata_counter_text = await client_metadata_counter.text(); | ||
// Check that the client metadata response is not cached. If the client metadata response was | ||
// cached, when the user visits the IDP as a first party, the IDP would be able to determine the | ||
// last RP the user visited regardless of whether the user granted consent via the FedCM prompt. | ||
assert_equals(client_metadata_counter_text, "2"); | ||
}, 'Test client_metadata request is not cached'); | ||
</script> |
30 changes: 30 additions & 0 deletions
30
testing/web-platform/tests/credential-management/fedcm-endpoint-redirects.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
fedcm_test, | ||
select_manifest, | ||
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
let test_options = request_options_with_mediation_required("manifest_redirect_accounts.json"); | ||
await select_manifest(t, test_options); | ||
|
||
const cred = fedcm_get_and_select_first_account(t, test_options); | ||
return promise_rejects_dom(t, 'NetworkError', cred); | ||
}, 'Test that promise is rejected if accounts endpoint redirects'); | ||
|
||
fedcm_test(async t => { | ||
let test_options = request_options_with_mediation_required("manifest_redirect_token.json"); | ||
await select_manifest(t, test_options); | ||
|
||
const cred = fedcm_get_and_select_first_account(t, test_options); | ||
return promise_rejects_dom(t, 'NetworkError', cred); | ||
}, 'Test that token endpoint does not follow redirects'); | ||
</script> |
19 changes: 19 additions & 0 deletions
19
testing/web-platform/tests/credential-management/fedcm-manifest-not-in-list.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
fedcm_test, | ||
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
let test_options = request_options_with_mediation_required('manifest-not-in-list.json'); | ||
const cred = fedcm_get_and_select_first_account(t, test_options); | ||
return promise_rejects_dom(t, 'NetworkError', cred); | ||
}, 'Test that the promise is rejected if the manifest is not in the manifest list'); | ||
</script> |
210 changes: 0 additions & 210 deletions
210
testing/web-platform/tests/credential-management/fedcm-network-requests.https.html
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
testing/web-platform/tests/credential-management/fedcm-nonce-is-optional.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API network request 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_mediation_required, | ||
fedcm_test, | ||
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
let test_options = request_options_with_mediation_required(); | ||
assert_true("nonce" in test_options.identity.providers[0]); | ||
delete test_options.identity.providers[0].nonce; | ||
const cred = await fedcm_get_and_select_first_account(t, test_options); | ||
assert_equals(cred.token, "token"); | ||
}, "nonce is not required in FederatedIdentityProvider."); | ||
</script> |
Oops, something went wrong.