-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The base::Feature needs to be enabled in order to allow the WPTs to be run correctly. Note that the feature is still gated on the Blink RuntimeEnabledFeature. Bug: 1440192 Change-Id: I67a05889234451c126190c91030201dbfe5dbd60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4595640 Reviewed-by: Christian Biesinger <[email protected]> Reviewed-by: Rakina Zata Amni <[email protected]> Commit-Queue: Nicolás Peña <[email protected]> Cr-Commit-Position: refs/heads/main@{#1154713}
- Loading branch information
1 parent
68792ad
commit 8969965
Showing
4 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
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,33 @@ | ||
<!DOCTYPE html> | ||
<title>Federated Credential Management API login hint 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="/service-workers/service-worker/resources/test-helpers.sub.js"></script> | ||
<body> | ||
|
||
<script type="module"> | ||
import {fedcm_test, | ||
request_options_with_login_hint, | ||
select_manifest} from './support/fedcm-helper.sub.js'; | ||
|
||
fedcm_test(async t => { | ||
let options = request_options_with_login_hint('manifest.py', 'nomatch'); | ||
const cred = navigator.credentials.get(options); | ||
return promise_rejects_dom(t, "NetworkError", cred); | ||
}, "No login hint matches an account."); | ||
|
||
fedcm_test(async t => { | ||
let options = request_options_with_login_hint('manifest.py', 'john_doe'); | ||
const cred = await navigator.credentials.get(options); | ||
assert_equals(cred.token, 'token'); | ||
}, "Login hint matches an account."); | ||
|
||
fedcm_test(async t => { | ||
let options = request_options_with_login_hint('manifest_with_two_accounts.json', 'john_doe'); | ||
await select_manifest(t, options); | ||
|
||
const cred = await navigator.credentials.get(options); | ||
assert_equals(cred.token, 'account_id=john_doe'); | ||
}, "Login hint matches an account from two accounts."); | ||
</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
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 |
---|---|---|
|
@@ -20,7 +20,8 @@ def main(request, response): | |
"name": "John Doe", | ||
"email": "[email protected]", | ||
"picture": "https://idp.example/profile/123", | ||
"approved_clients": ["123", "456", "789"] | ||
"approved_clients": ["123", "456", "789"], | ||
"login_hints": ["john_doe"] | ||
}] | ||
} | ||
""" |
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 |
---|---|---|
|
@@ -29,7 +29,8 @@ def main(request, response): | |
"name": "John Doe", | ||
"email": "[email protected]", | ||
"picture": "https://idp.example/profile/123", | ||
"approved_clients": ["123", "456", "789"] | ||
"approved_clients": ["123", "456", "789"], | ||
"login_hints": ["john_doe"] | ||
} | ||
] | ||
} | ||
|