Skip to content

Commit

Permalink
Bug 1837056 [wpt PR 40399] - [FedCM] Add WPTs for loginHint, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
[FedCM] Add WPTs for loginHint

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 <cbiesingerchromium.org>
Reviewed-by: Rakina Zata Amni <rakinachromium.org>
Commit-Queue: Nicolás Peña <npmchromium.org>
Cr-Commit-Position: refs/heads/main{#1154713}

--

wpt-commits: 8969965f2a5f0e7ad096c87e336a06a17b2b89f4
wpt-pr: 40399

UltraBlame original commit: bac7683d8db624d8a53b1d9e3f19c15d8dcc2608
  • Loading branch information
marco-c committed Jun 16, 2023
1 parent 533faef commit 1df0e17
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
<
!
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
>
Original file line number Diff line number Diff line change
Expand Up @@ -707,3 +707,36 @@ manifest_url
)
;
}
export
function
request_options_with_login_hint
(
manifest_filename
login_hint
)
{
let
options
=
request_options_with_mediation_required
(
manifest_filename
)
;
options
.
identity
.
providers
[
0
]
.
loginHint
=
login_hint
;
return
options
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,16 @@
789
"
]

"
login_hints
"
:
[
"
john_doe
"
]

}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@
789
"
]

"
login_hints
"
:
[
"
john_doe
"
]

}

Expand Down

0 comments on commit 1df0e17

Please sign in to comment.