Skip to content

Commit 186d241

Browse files
committed
Bug 1978352 [wpt PR 53866] - Fix timeout in mouse_wheel test, a=testonly
Automatic update from web-platform-tests Fix timeout in mouse_wheel test Problems with the test: * potential to trigger input before the compositor is ready to handle the scroll * scroll amount was insufficient. Though a mouse-wheel scroll is directional, test-driver.scroll emulates a touchpad, which is not directional. Due to the margin-bottom, the distance between snap points is 110 and the initial scroll of 50 would snap back to the starting position. This was the source of the Timeout. * waitForAnimationEnd and waitForScrollTo resolve without an argument. Thus, the timestamp and evt were undefined. * No benefit to waiting to reach a scroll position separate from waiting for the scroll position to stabilize, as the stabilization must trigger at a time well after the last scroll is received. * A test that scrollend is received after the snap belongs in dom/event. * Assert_equals is problematic for scroll position since the position can be tweaked to align with a physical pixel boundary to reduce anti-aliasing. Bug: 40814982 Change-Id: I0ba377c7ca9c00d047ee020e1355625e2e1ccac4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6765747 Reviewed-by: David Awogbemila <awogbemilachromium.org> Commit-Queue: Kevin Ellis <keverschromium.org> Cr-Commit-Position: refs/heads/main{#1490359} -- wpt-commits: 9633ad67f55f8c06cfdb0604258582d3f5c21ab8 wpt-pr: 53866 UltraBlame original commit: a4dba8bfbf3c06d3525cc5fde707a941a7ae2069
1 parent 3d49cc7 commit 186d241

File tree

1 file changed

+109
-86
lines changed

1 file changed

+109
-86
lines changed

testing/web-platform/tests/css/css-scroll-snap/input/mouse-wheel.html

Lines changed: 109 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,27 @@
239239
src
240240
=
241241
"
242+
/
243+
dom
244+
/
245+
events
246+
/
247+
scrolling
248+
/
249+
scroll_support
250+
.
251+
js
252+
"
253+
>
254+
<
255+
/
256+
script
257+
>
258+
<
259+
script
260+
src
261+
=
262+
"
242263
.
243264
.
244265
/
@@ -275,6 +296,11 @@
275296
>
276297
<
277298
div
299+
id
300+
=
301+
"
302+
target
303+
"
278304
class
279305
=
280306
"
@@ -311,6 +337,11 @@
311337
=
312338
>
313339
{
340+
await
341+
waitForCompositorReady
342+
(
343+
)
344+
;
314345
const
315346
scroller
316347
=
@@ -378,6 +409,33 @@
378409
)
379410
;
380411
const
412+
targetBounds
413+
=
414+
document
415+
.
416+
getElementById
417+
(
418+
'
419+
target
420+
'
421+
)
422+
.
423+
getBoundingClientRect
424+
(
425+
)
426+
;
427+
const
428+
dy
429+
=
430+
targetBounds
431+
.
432+
top
433+
/
434+
2
435+
+
436+
1
437+
;
438+
const
381439
actions
382440
=
383441
new
@@ -392,7 +450,7 @@
392450
50
393451
50
394452
0
395-
50
453+
dy
396454
{
397455
origin
398456
:
@@ -416,12 +474,6 @@
416474
await
417475
scrollPromise
418476
;
419-
let
420-
scrollEndTime
421-
;
422-
let
423-
snapEndTime
424-
;
425477
/
426478
/
427479
Detect
@@ -430,83 +482,69 @@
430482
in
431483
scrolling
432484
.
485+
As
486+
expected
487+
to
488+
snap
489+
right
490+
at
491+
the
492+
end
493+
of
494+
/
495+
/
496+
the
497+
scroll
498+
there
499+
should
500+
be
501+
no
502+
appreciable
503+
pause
504+
before
505+
the
506+
snap
507+
takes
508+
/
509+
/
510+
place
511+
.
512+
Once
513+
the
514+
scrolling
515+
settles
516+
we
517+
are
518+
expected
519+
to
520+
be
521+
at
522+
the
523+
snap
524+
/
525+
/
526+
position
527+
.
433528
const
434529
scrollStabilizedPromise
435530
=
436531
waitForAnimationEnd
437532
(
438533
scrollTop
439534
)
440-
.
441-
then
442-
(
443-
(
444-
timestamp
445-
)
446-
=
447-
>
448-
{
449-
scrollEndTime
450-
=
451-
timestamp
452-
;
453-
}
454-
)
455-
;
456-
const
457-
snapEndPromise
458-
=
459-
waitForScrollTo
460-
(
461-
scroller
462-
(
463-
)
464-
=
465-
>
466-
{
467-
return
468-
scroller
469-
.
470-
scrollTop
471-
;
472-
}
473-
110
474-
)
475-
.
476-
then
477-
(
478-
(
479-
evt
480-
)
481-
=
482-
>
483-
{
484-
snapEndTime
485-
=
486-
evt
487-
.
488-
timestamp
489-
;
490-
}
491-
)
492535
;
493536
await
494-
Promise
495-
.
496-
all
497-
(
498-
[
499537
scrollStabilizedPromise
500-
snapEndPromise
501-
]
502-
)
503538
;
504-
assert_equals
539+
assert_approx_equals
505540
(
506541
scroller
507542
.
508543
scrollTop
509544
110
545+
0
546+
.
547+
5
510548
'
511549
Failed
512550
to
@@ -518,23 +556,6 @@
518556
'
519557
)
520558
;
521-
assert_true
522-
(
523-
snapEndTime
524-
<
525-
scrollEndTime
526-
'
527-
Detected
528-
pause
529-
in
530-
scrolling
531-
before
532-
reaching
533-
snap
534-
target
535-
'
536-
)
537-
;
538559
}
539560
"
540561
Wheel
@@ -545,7 +566,9 @@
545566
to
546567
target
547568
position
548-
immediately
569+
without
570+
intermediate
571+
pause
549572
.
550573
"
551574
)

0 commit comments

Comments
 (0)