Bump the wait for scrollend / scroll completion timeout for tests that include a smooth scroll
Test List
- scrollend-event-fired-for-mandatory-snap-point-after-load.html
- scrollend-event-fired-for-programmatic-scroll.html?include=root-scrollBy-smooth
- scrollend-event-fired-for-programmatic-scroll.html?include=root-scrollTo-smooth
- scrollend-event-fired-for-programmatic-scroll.html?include=subframe-scrollBy-smooth
- scrollend-event-fired-for-programmatic-scroll.html?include=subframe-scrollTo-smooth
- scrollend-event-fired-for-scroll-attr-change.html?include=root-scrollLeft-smooth
- scrollend-event-fired-for-scroll-attr-change.html?include=root-scrollTop-smooth
- scrollend-event-fired-for-scroll-attr-change.html?include=subframe-scrollLeft-smooth
- scrollend-event-fired-for-scroll-attr-change.html?include=subframe-scrollTop-smooth
- scrollend-event-handler-content-attributes.html
- scrollend-with-snap-on-fractional-offset.html
Rationale
Many scrollend tests either use waitFor or createScrollendPromiseForTarget. The function waitFor has a hard timeout of 700 frames here, while createScrollendPromiseForTarget has a default timeout of 500ms. We should consider bumping these timeout values. Especially in cases where the test makes use of a smooth scroll.
The comment above waitFor says
// TODO(crbug.com/1400399): deprecate. We should not use frame based waits in
// WPT as frame rates may vary greatly in different testing environments.
At 60fps, 700 frames is 11.67s. At 120fps, it's 5.83s.
createScrollendPromiseForTarget accepts a timeout argument, which flows through to t.step_timeout() (docs). Could the smooth scroll tests set a longer timeout?
What is the longest duration for a smooth scroll in implementations?
cc: @vmpstr for review
Bumping the timeouts sounds fine to me. I can try to find out what the longest duration in chromium is but I have no clue about other implementations.
However, I spot-checked scrollend-event-fired-for-programmatic-scroll.html?include=root-scrollBy-smooth and scrollend-event-fired-for-programmatic-scroll.html?include=root-scrollTo-smooth and compared the results with their "auto" versions. Looks like firefox passes the "auto" versions (which I believe do an instant scroll) but times out on the smooth versions. But even on the passing "auto" versions the firefox runs take ~7 seconds and chromium and Edge typically take <1 second? Perhaps the duration in firefox is longer than the duration in chromium?
seems ok to me
Looks like there is agreement here. @dlrobertson would you mind creating a PR for the change?