Skip to content

Commit

Permalink
Bug 1931981 [wpt PR 49240] - Put timing values of DocumentTiming in a…
Browse files Browse the repository at this point in the history
… 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: ce191cb10c4d62462deb3f39d1fa9f4f168987f4
  • Loading branch information
marco-c committed Nov 26, 2024
1 parent a7e9fe8 commit a41ecd6
Show file tree
Hide file tree
Showing 2 changed files with 351 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
validates
that
a
PerformanceNavigatingTiming
PerformanceNavigationTiming
corresponding
to
a
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,350 @@
<
!
DOCTYPE
HTML
>
<
html
>
<
head
>
<
meta
charset
=
utf
-
8
>
<
title
>
PerformanceNavigationTiming
timing
remains
after
iframe
removed
<
/
title
>
<
script
src
=
"
/
resources
/
testharness
.
js
"
>
<
/
script
>
<
script
src
=
"
/
resources
/
testharnessreport
.
js
"
>
<
/
script
>
<
/
head
>
<
body
>
<
script
>
const
timingAttributes
=
[
'
domComplete
'
'
domContentLoadedEventEnd
'
'
domContentLoadedEventStart
'
'
domInteractive
'
]
;
function
verify_timing
(
pnt
description
)
{
for
(
const
att
of
timingAttributes
)
{
assert_greater_than
(
pnt
[
att
]
0
{
description
}
{
att
}
)
;
}
}
promise_test
(
async
function
(
t
)
{
const
iframe
=
document
.
createElement
(
"
iframe
"
)
;
document
.
body
.
appendChild
(
iframe
)
;
iframe
.
src
=
"
resources
/
blank_page_green
.
html
"
;
await
new
Promise
(
resolve
=
>
{
iframe
.
onload
=
function
(
)
{
assert_equals
(
iframe
.
contentWindow
.
performance
.
getEntriesByType
(
"
navigation
"
)
.
length
1
"
Only
one
navigation
time
entry
"
)
;
const
pnt
=
iframe
.
contentWindow
.
performance
.
getEntriesByType
(
"
navigation
"
)
[
0
]
;
assert_equals
(
pnt
.
name
iframe
.
contentWindow
.
location
.
toString
(
)
"
navigation
name
matches
the
window
.
location
"
)
;
assert_true
(
pnt
.
name
.
endsWith
(
"
blank_page_green
.
html
"
)
"
navigation
name
is
blank_page_green
.
html
"
)
;
verify_timing
(
pnt
"
timing
values
should
be
positive
number
:
"
)
;
iframe
.
remove
(
)
;
verify_timing
(
pnt
"
timing
values
should
remain
positive
after
iframe
is
removed
:
"
)
;
resolve
(
)
;
}
}
)
;
}
"
iframe
navigation
times
are
persistent
after
the
iframe
is
removed
.
"
)
;
<
/
script
>
<
/
body
>
<
/
html
>

0 comments on commit a41ecd6

Please sign in to comment.