From 7e2faa9cf5dc8594be90a966883eada469238a7f Mon Sep 17 00:00:00 2001 From: Richard Robinson Date: Thu, 22 Sep 2022 17:07:19 -0700 Subject: [PATCH] [ New Test ] (254561@main): [ macOS wk2 ] fast/scrolling/mac/keyboard-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 --- .../mac/keyboard-scrolling-with-mouse-scroll.html | 9 ++++++--- LayoutTests/platform/mac-wk2/TestExpectations | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html index 19b7311943c9..9704f1fe8f06 100644 --- a/LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html +++ b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html @@ -14,6 +14,7 @@ async function runTest() { + eventSender.monitorWheelEvents(); if (!window.testRunner || !testRunner.runUIScript) return; @@ -21,13 +22,15 @@ 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); diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations index 72ae0b055207..75677bbb4848 100644 --- a/LayoutTests/platform/mac-wk2/TestExpectations +++ b/LayoutTests/platform/mac-wk2/TestExpectations @@ -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 ]