Skip to content

Commit

Permalink
Bug 1856722 [wpt PR 42227] - gamepad: Check that the DocumentLoader i…
Browse files Browse the repository at this point in the history
…s not null, a=testonly

Automatic update from web-platform-tests
gamepad: Check that the DocumentLoader is not null

Gamepad timestamps are reported relative to the navigationStart
timestamp, accessed from the DocumentLoader's DocumentLoadTiming.
In some scenarios the document may have been detached before the
NavigatorGamepad is initialized, causing the DocumentLoader to be
nullptr.

This CL checks that the DocumentLoader is non-null, and uses the
current time in place of navigationStart if it is null.

Bug: 1483777
Change-Id: Ib3efcf3a612cd4c1c543218fa5fb8568c7129dcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4899018
Reviewed-by: Alvin Ji <alvinjichromium.org>
Commit-Queue: Matt Reynolds <mattreynoldschromium.org>
Cr-Commit-Position: refs/heads/main{#1204813}

--

wpt-commits: 3ae2cb8c5b5ba61809da15318821a6c1fe54829f
wpt-pr: 42227

UltraBlame original commit: bd7b3f9a73985da44f9bc6702a32ec864a47b024
  • Loading branch information
marco-c committed Oct 13, 2023
1 parent 9adebd0 commit b1c4f5d
Showing 1 changed file with 215 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<
!
DOCTYPE
html
>
<
head
>
<
script
src
=
"
.
.
/
resources
/
js
-
test
.
js
"
>
<
/
script
>
<
script
>
function
onLoad
(
)
{
const
x1
=
document
.
getElementById
(
'
x1
'
)
;
x1
.
addEventListener
(
'
DOMSubtreeModified
'
(
)
=
>
{
const
x2
=
document
.
getElementById
(
'
x2
'
)
;
x2
.
contentDocument
;
}
)
;
x1
.
setAttribute
(
'
inputmode
'
'
url
'
)
;
}
function
insertAdjacent
(
)
{
const
x2
=
document
.
getElementById
(
'
x2
'
)
;
const
x3
=
document
.
getElementById
(
'
x3
'
)
;
document
.
onreadystatechange
=
insertAdjacent
;
x3
.
insertAdjacentElement
(
'
beforebegin
'
x2
)
;
}
<
/
script
>
<
/
head
>
<
body
onload
=
"
onLoad
(
)
"
>
<
div
id
=
"
x1
"
>
<
/
div
>
<
object
id
=
"
x2
"
data
=
"
invalid
-
url
"
onerror
=
"
insertAdjacent
(
)
"
>
<
/
object
>
<
div
id
=
"
x3
"
>
<
/
div
>
<
/
body
>
<
/
html
>

0 comments on commit b1c4f5d

Please sign in to comment.