Skip to content

Commit 2b1c369

Browse files
committed
Bug 1990871 [wpt PR 55066] - Expose navigation.transition.to, a=testonly
Automatic update from web-platform-tests Expose navigation.transition.to This exposes the destination of an ongoing navigation. Spec PR: whatwg/html#11692 I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68d4ff4d.2b0a0220.29ae18.0091.GAE%40google.com R=japhetchromium.org Bug: 447171238 Change-Id: I1d2fbb7c0b7f2656ca4392be4d1beac34d9012ac Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6982944 Reviewed-by: Nate Chapin <japhetchromium.org> Commit-Queue: Noam Rosenthal <nrosenthalgoogle.com> Cr-Commit-Position: refs/heads/main{#1520724} -- wpt-commits: 2688294120cb74f80bdd9959e8f6bcb8c731c98f wpt-pr: 55066 UltraBlame original commit: afab78513b2fbac59a141ab3f09c4d0239be15f5
1 parent 49a0f98 commit 2b1c369

File tree

1 file changed

+323
-0
lines changed

1 file changed

+323
-0
lines changed
Lines changed: 323 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
<
2+
!
3+
doctype
4+
html
5+
>
6+
<
7+
script
8+
src
9+
=
10+
"
11+
/
12+
resources
13+
/
14+
testharness
15+
.
16+
js
17+
"
18+
>
19+
<
20+
/
21+
script
22+
>
23+
<
24+
script
25+
src
26+
=
27+
"
28+
/
29+
resources
30+
/
31+
testharnessreport
32+
.
33+
js
34+
"
35+
>
36+
<
37+
/
38+
script
39+
>
40+
<
41+
script
42+
>
43+
promise_test
44+
(
45+
async
46+
(
47+
t
48+
)
49+
=
50+
>
51+
{
52+
/
53+
/
54+
Wait
55+
for
56+
after
57+
the
58+
load
59+
event
60+
so
61+
that
62+
the
63+
navigation
64+
doesn
65+
'
66+
t
67+
get
68+
converted
69+
/
70+
/
71+
into
72+
a
73+
replace
74+
navigation
75+
.
76+
await
77+
new
78+
Promise
79+
(
80+
r
81+
=
82+
>
83+
window
84+
.
85+
onload
86+
=
87+
(
88+
)
89+
=
90+
>
91+
t
92+
.
93+
step_timeout
94+
(
95+
r
96+
0
97+
)
98+
)
99+
;
100+
const
101+
precommit
102+
=
103+
Promise
104+
.
105+
withResolvers
106+
(
107+
)
108+
;
109+
const
110+
handler
111+
=
112+
Promise
113+
.
114+
withResolvers
115+
(
116+
)
117+
;
118+
const
119+
handler_done
120+
=
121+
Promise
122+
.
123+
withResolvers
124+
(
125+
)
126+
;
127+
const
128+
commit
129+
=
130+
Promise
131+
.
132+
withResolvers
133+
(
134+
)
135+
;
136+
navigation
137+
.
138+
addEventListener
139+
(
140+
"
141+
navigate
142+
"
143+
e
144+
=
145+
>
146+
{
147+
e
148+
.
149+
intercept
150+
(
151+
{
152+
async
153+
precommitHandler
154+
(
155+
)
156+
{
157+
precommit
158+
.
159+
resolve
160+
(
161+
e
162+
)
163+
;
164+
await
165+
commit
166+
.
167+
promise
168+
;
169+
}
170+
async
171+
handler
172+
(
173+
)
174+
{
175+
handler
176+
.
177+
resolve
178+
(
179+
)
180+
;
181+
await
182+
handler_done
183+
.
184+
promise
185+
;
186+
}
187+
}
188+
)
189+
;
190+
}
191+
)
192+
;
193+
assert_equals
194+
(
195+
navigation
196+
.
197+
transition
198+
null
199+
)
200+
;
201+
navigation
202+
.
203+
navigate
204+
(
205+
"
206+
?
207+
next
208+
"
209+
)
210+
;
211+
const
212+
navigate_event
213+
=
214+
await
215+
precommit
216+
.
217+
promise
218+
;
219+
const
220+
old_entry
221+
=
222+
navigation
223+
.
224+
currentEntry
225+
;
226+
assert_equals
227+
(
228+
navigation
229+
.
230+
transition
231+
.
232+
from
233+
old_entry
234+
)
235+
;
236+
assert_equals
237+
(
238+
navigation
239+
.
240+
transition
241+
.
242+
to
243+
navigate_event
244+
.
245+
destination
246+
)
247+
;
248+
commit
249+
.
250+
resolve
251+
(
252+
)
253+
;
254+
await
255+
handler
256+
.
257+
promise
258+
;
259+
assert_equals
260+
(
261+
navigation
262+
.
263+
transition
264+
.
265+
from
266+
old_entry
267+
)
268+
;
269+
assert_equals
270+
(
271+
navigation
272+
.
273+
transition
274+
.
275+
to
276+
navigate_event
277+
.
278+
destination
279+
)
280+
;
281+
assert_equals
282+
(
283+
navigation
284+
.
285+
transition
286+
.
287+
to
288+
.
289+
url
290+
navigation
291+
.
292+
currentEntry
293+
.
294+
url
295+
)
296+
;
297+
handler_done
298+
.
299+
resolve
300+
(
301+
)
302+
;
303+
}
304+
"
305+
navigation
306+
.
307+
transition
308+
.
309+
to
310+
matches
311+
the
312+
navigate
313+
event
314+
'
315+
s
316+
destination
317+
"
318+
)
319+
;
320+
<
321+
/
322+
script
323+
>

0 commit comments

Comments
 (0)