Skip to content

Commit 1df0e17

Browse files
committed
Bug 1837056 [wpt PR 40399] - [FedCM] Add WPTs for loginHint, a=testonly
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
1 parent 533faef commit 1df0e17

File tree

4 files changed

+375
-0
lines changed

4 files changed

+375
-0
lines changed
Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
<
2+
!
3+
DOCTYPE
4+
html
5+
>
6+
<
7+
title
8+
>
9+
Federated
10+
Credential
11+
Management
12+
API
13+
login
14+
hint
15+
tests
16+
.
17+
<
18+
/
19+
title
20+
>
21+
<
22+
link
23+
rel
24+
=
25+
"
26+
help
27+
"
28+
href
29+
=
30+
"
31+
https
32+
:
33+
/
34+
/
35+
fedidcg
36+
.
37+
github
38+
.
39+
io
40+
/
41+
FedCM
42+
"
43+
>
44+
<
45+
script
46+
src
47+
=
48+
"
49+
/
50+
resources
51+
/
52+
testharness
53+
.
54+
js
55+
"
56+
>
57+
<
58+
/
59+
script
60+
>
61+
<
62+
script
63+
src
64+
=
65+
"
66+
/
67+
resources
68+
/
69+
testharnessreport
70+
.
71+
js
72+
"
73+
>
74+
<
75+
/
76+
script
77+
>
78+
<
79+
script
80+
src
81+
=
82+
"
83+
/
84+
service
85+
-
86+
workers
87+
/
88+
service
89+
-
90+
worker
91+
/
92+
resources
93+
/
94+
test
95+
-
96+
helpers
97+
.
98+
sub
99+
.
100+
js
101+
"
102+
>
103+
<
104+
/
105+
script
106+
>
107+
<
108+
body
109+
>
110+
<
111+
script
112+
type
113+
=
114+
"
115+
module
116+
"
117+
>
118+
import
119+
{
120+
fedcm_test
121+
request_options_with_login_hint
122+
select_manifest
123+
}
124+
from
125+
'
126+
.
127+
/
128+
support
129+
/
130+
fedcm
131+
-
132+
helper
133+
.
134+
sub
135+
.
136+
js
137+
'
138+
;
139+
fedcm_test
140+
(
141+
async
142+
t
143+
=
144+
>
145+
{
146+
let
147+
options
148+
=
149+
request_options_with_login_hint
150+
(
151+
'
152+
manifest
153+
.
154+
py
155+
'
156+
'
157+
nomatch
158+
'
159+
)
160+
;
161+
const
162+
cred
163+
=
164+
navigator
165+
.
166+
credentials
167+
.
168+
get
169+
(
170+
options
171+
)
172+
;
173+
return
174+
promise_rejects_dom
175+
(
176+
t
177+
"
178+
NetworkError
179+
"
180+
cred
181+
)
182+
;
183+
}
184+
"
185+
No
186+
login
187+
hint
188+
matches
189+
an
190+
account
191+
.
192+
"
193+
)
194+
;
195+
fedcm_test
196+
(
197+
async
198+
t
199+
=
200+
>
201+
{
202+
let
203+
options
204+
=
205+
request_options_with_login_hint
206+
(
207+
'
208+
manifest
209+
.
210+
py
211+
'
212+
'
213+
john_doe
214+
'
215+
)
216+
;
217+
const
218+
cred
219+
=
220+
await
221+
navigator
222+
.
223+
credentials
224+
.
225+
get
226+
(
227+
options
228+
)
229+
;
230+
assert_equals
231+
(
232+
cred
233+
.
234+
token
235+
'
236+
token
237+
'
238+
)
239+
;
240+
}
241+
"
242+
Login
243+
hint
244+
matches
245+
an
246+
account
247+
.
248+
"
249+
)
250+
;
251+
fedcm_test
252+
(
253+
async
254+
t
255+
=
256+
>
257+
{
258+
let
259+
options
260+
=
261+
request_options_with_login_hint
262+
(
263+
'
264+
manifest_with_two_accounts
265+
.
266+
json
267+
'
268+
'
269+
john_doe
270+
'
271+
)
272+
;
273+
await
274+
select_manifest
275+
(
276+
t
277+
options
278+
)
279+
;
280+
const
281+
cred
282+
=
283+
await
284+
navigator
285+
.
286+
credentials
287+
.
288+
get
289+
(
290+
options
291+
)
292+
;
293+
assert_equals
294+
(
295+
cred
296+
.
297+
token
298+
'
299+
account_id
300+
=
301+
john_doe
302+
'
303+
)
304+
;
305+
}
306+
"
307+
Login
308+
hint
309+
matches
310+
an
311+
account
312+
from
313+
two
314+
accounts
315+
.
316+
"
317+
)
318+
;
319+
<
320+
/
321+
script
322+
>

testing/web-platform/tests/credential-management/support/fedcm-helper.sub.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,3 +707,36 @@ manifest_url
707707
)
708708
;
709709
}
710+
export
711+
function
712+
request_options_with_login_hint
713+
(
714+
manifest_filename
715+
login_hint
716+
)
717+
{
718+
let
719+
options
720+
=
721+
request_options_with_mediation_required
722+
(
723+
manifest_filename
724+
)
725+
;
726+
options
727+
.
728+
identity
729+
.
730+
providers
731+
[
732+
0
733+
]
734+
.
735+
loginHint
736+
=
737+
login_hint
738+
;
739+
return
740+
options
741+
;
742+
}

testing/web-platform/tests/credential-management/support/fedcm/accounts.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,16 @@
266266
789
267267
"
268268
]
269+
270+
"
271+
login_hints
272+
"
273+
:
274+
[
275+
"
276+
john_doe
277+
"
278+
]
269279

270280
}
271281
]

testing/web-platform/tests/credential-management/support/fedcm/two_accounts.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@
338338
789
339339
"
340340
]
341+
342+
"
343+
login_hints
344+
"
345+
:
346+
[
347+
"
348+
john_doe
349+
"
350+
]
341351

342352
}
343353

0 commit comments

Comments
 (0)