-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FedCM] Split button flow web tests into multiple files
The basic tests file would grow with more tests coming so it makes sense to split some into a new file. In addition, this helps with debugging new flaky tests. Bug: 328129675, 41489720 Change-Id: Ie3cde046b3e13febdb3d57bf8cce7567ddb530dc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5352771 Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Yi Gu <yigu@chromium.org> Commit-Queue: Yi Gu <yigu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1270323}
- Loading branch information
1 parent
85e057d
commit 9208837
Showing
2 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...l-management/fedcm-button-and-other-account/fedcm-button-mode-basics.tentative.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,34 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API Button Mode basic 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(); | ||
test_options.identity.mode = "button"; | ||
await select_manifest(t, test_options); | ||
|
||
let result = navigator.credentials.get(test_options); | ||
return promise_rejects_dom(t, 'NetworkError', result); | ||
}, "Test that the button mode without user activation will fail."); | ||
|
||
fedcm_test(async t => { | ||
let test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); | ||
test_options.identity.mode = "button"; | ||
|
||
return test_driver.bless('initiate FedCM request', async function() { | ||
let cred = await fedcm_get_and_select_first_account(t, test_options); | ||
assert_equals(cred.token, "mode=button"); | ||
}); | ||
}, "Test that the button mode succeeds with user activation."); | ||
|
||
</script> |
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