Skip to content

Commit

Permalink
[ New Test ] (254561@main): [ macOS wk2 ] fast/scrolling/mac/keyboard…
Browse files Browse the repository at this point in the history
…-scrolling-with-mouse-scroll.html is a flaky failure (245482)

https://bugs.webkit.org/show_bug.cgi?id=245503
rdar://100227233

Reviewed by Aditya Keerthi.

The original test was flaky because it depended on the scroll position after
a duration of time using `setTimeout`. However, because this is not guaranteed,
the scroll position could vary, causing the test assertion to fail.

This PR fixes this issue by measuring the scroll position relative to the
position immediately after the key up event, which gets rid of this possible
variation.

Additionally, this PR improves upon the original test by having the wheel event
have no delta scroll position; it is only important for the test that the wheel
event properly interrupts the keyboard scrolling. This also removes a possible
vector of variation.

* LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/254771@main
  • Loading branch information
rr-codes authored and pxlcoder committed Sep 23, 2022
1 parent 3317fbd commit 7e2faa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -14,20 +14,23 @@

async function runTest()
{
eventSender.monitorWheelEvents();
if (!window.testRunner || !testRunner.runUIScript)
return;

await UIHelper.rawKeyDown("downArrow");

setTimeout(async () => {
await UIHelper.rawKeyUp("downArrow");
await UIHelper.mouseWheelScrollAt(10, 10, 0, 1, 0, 10);
const startingPosition = window.scrollY;

await UIHelper.mouseWheelScrollAt(0, 0, 0, 0, 0, 0);

const position = window.scrollY;
if (position <= 1)
if (Math.abs(startingPosition - position) < 20)
debug("Successful.");
else
debug("Unsuccessful. window.scrollY == " + position);
debug("Unsuccessful. window.scrollY after wheel event == " + position + "; window.scrollY before wheel event == " + startingPosition);

testRunner.notifyDone();
}, 100);
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/mac-wk2/TestExpectations
Expand Up @@ -1127,8 +1127,6 @@ webkit.org/b/229076 [ BigSur Debug ] webrtc/video-interruption.html [ Pass Crash

webkit.org/b/213804 fast/scrolling/mac/scroll-snapping-in-progress.html [ Pass Failure ]

webkit.org/b/245482 fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html [ Pass Failure ]

webkit.org/b/229206 [ Debug ] http/wpt/webrtc/sframe-transform-error.html [ Pass Failure ]

webkit.org/b/214478 [ Debug ] http/wpt/webrtc/generateCertificate.html [ Skip ]
Expand Down

0 comments on commit 7e2faa9

Please sign in to comment.