Skip to content

Commit 23264d8

Browse files
committed
Bug 1931981 [wpt PR 49240] - Put timing values of DocumentTiming in a GCed object, a=testonly
Automatic update from web-platform-tests Put timing values of DocumentTiming in a GCed object So they can outlive the document, and PerformanceNavigationTiming can collect them. Bug: 40793421 Change-Id: I2cbb53862ff9fab08f963d9408ef65ff462e5dd7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5935276 Reviewed-by: David Baron <dbaronchromium.org> Commit-Queue: Guohui Deng <guohuidengmicrosoft.com> Reviewed-by: Noam Rosenthal <nrosenthalchromium.org> Cr-Commit-Position: refs/heads/main{#1384608} -- wpt-commits: d639d949a473d412a3557eab71eba43a58420f3f wpt-pr: 49240 UltraBlame original commit: 92f59d4dfaef738a93107a8c5a1739c9e0d83fb7
1 parent 1080e45 commit 23264d8

File tree

2 files changed

+351
-1
lines changed

2 files changed

+351
-1
lines changed

testing/web-platform/tests/navigation-timing/nav2-test-document-replaced.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
validates
340340
that
341341
a
342-
PerformanceNavigatingTiming
342+
PerformanceNavigationTiming
343343
corresponding
344344
to
345345
a
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,350 @@
1+
<
2+
!
3+
DOCTYPE
4+
HTML
5+
>
6+
<
7+
html
8+
>
9+
<
10+
head
11+
>
12+
<
13+
meta
14+
charset
15+
=
16+
utf
17+
-
18+
8
19+
>
20+
<
21+
title
22+
>
23+
PerformanceNavigationTiming
24+
timing
25+
remains
26+
after
27+
iframe
28+
removed
29+
<
30+
/
31+
title
32+
>
33+
<
34+
script
35+
src
36+
=
37+
"
38+
/
39+
resources
40+
/
41+
testharness
42+
.
43+
js
44+
"
45+
>
46+
<
47+
/
48+
script
49+
>
50+
<
51+
script
52+
src
53+
=
54+
"
55+
/
56+
resources
57+
/
58+
testharnessreport
59+
.
60+
js
61+
"
62+
>
63+
<
64+
/
65+
script
66+
>
67+
<
68+
/
69+
head
70+
>
71+
<
72+
body
73+
>
74+
<
75+
script
76+
>
77+
const
78+
timingAttributes
79+
=
80+
[
81+
'
82+
domComplete
83+
'
84+
'
85+
domContentLoadedEventEnd
86+
'
87+
'
88+
domContentLoadedEventStart
89+
'
90+
'
91+
domInteractive
92+
'
93+
]
94+
;
95+
function
96+
verify_timing
97+
(
98+
pnt
99+
description
100+
)
101+
{
102+
for
103+
(
104+
const
105+
att
106+
of
107+
timingAttributes
108+
)
109+
{
110+
assert_greater_than
111+
(
112+
pnt
113+
[
114+
att
115+
]
116+
0
117+
{
118+
description
119+
}
120+
{
121+
att
122+
}
123+
)
124+
;
125+
}
126+
}
127+
promise_test
128+
(
129+
async
130+
function
131+
(
132+
t
133+
)
134+
{
135+
const
136+
iframe
137+
=
138+
document
139+
.
140+
createElement
141+
(
142+
"
143+
iframe
144+
"
145+
)
146+
;
147+
document
148+
.
149+
body
150+
.
151+
appendChild
152+
(
153+
iframe
154+
)
155+
;
156+
iframe
157+
.
158+
src
159+
=
160+
"
161+
resources
162+
/
163+
blank_page_green
164+
.
165+
html
166+
"
167+
;
168+
await
169+
new
170+
Promise
171+
(
172+
resolve
173+
=
174+
>
175+
{
176+
iframe
177+
.
178+
onload
179+
=
180+
function
181+
(
182+
)
183+
{
184+
assert_equals
185+
(
186+
iframe
187+
.
188+
contentWindow
189+
.
190+
performance
191+
.
192+
getEntriesByType
193+
(
194+
"
195+
navigation
196+
"
197+
)
198+
.
199+
length
200+
1
201+
"
202+
Only
203+
one
204+
navigation
205+
time
206+
entry
207+
"
208+
)
209+
;
210+
const
211+
pnt
212+
=
213+
iframe
214+
.
215+
contentWindow
216+
.
217+
performance
218+
.
219+
getEntriesByType
220+
(
221+
"
222+
navigation
223+
"
224+
)
225+
[
226+
0
227+
]
228+
;
229+
assert_equals
230+
(
231+
pnt
232+
.
233+
name
234+
iframe
235+
.
236+
contentWindow
237+
.
238+
location
239+
.
240+
toString
241+
(
242+
)
243+
"
244+
navigation
245+
name
246+
matches
247+
the
248+
window
249+
.
250+
location
251+
"
252+
)
253+
;
254+
assert_true
255+
(
256+
pnt
257+
.
258+
name
259+
.
260+
endsWith
261+
(
262+
"
263+
blank_page_green
264+
.
265+
html
266+
"
267+
)
268+
"
269+
navigation
270+
name
271+
is
272+
blank_page_green
273+
.
274+
html
275+
"
276+
)
277+
;
278+
verify_timing
279+
(
280+
pnt
281+
"
282+
timing
283+
values
284+
should
285+
be
286+
positive
287+
number
288+
:
289+
"
290+
)
291+
;
292+
iframe
293+
.
294+
remove
295+
(
296+
)
297+
;
298+
verify_timing
299+
(
300+
pnt
301+
"
302+
timing
303+
values
304+
should
305+
remain
306+
positive
307+
after
308+
iframe
309+
is
310+
removed
311+
:
312+
"
313+
)
314+
;
315+
resolve
316+
(
317+
)
318+
;
319+
}
320+
}
321+
)
322+
;
323+
}
324+
"
325+
iframe
326+
navigation
327+
times
328+
are
329+
persistent
330+
after
331+
the
332+
iframe
333+
is
334+
removed
335+
.
336+
"
337+
)
338+
;
339+
<
340+
/
341+
script
342+
>
343+
<
344+
/
345+
body
346+
>
347+
<
348+
/
349+
html
350+
>

0 commit comments

Comments
 (0)