-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: ce191cb10c4d62462deb3f39d1fa9f4f168987f4
- Loading branch information
Showing
2 changed files
with
351 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,7 +339,7 @@ | |
validates | ||
that | ||
a | ||
PerformanceNavigatingTiming | ||
PerformanceNavigationTiming | ||
corresponding | ||
to | ||
a | ||
|
350 changes: 350 additions & 0 deletions
350
testing/web-platform/tests/navigation-timing/nav2-test-timing-persistent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
> |