⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280937 in webkit


Ignore:
Timestamp:
Aug 11, 2021, 4:51:07 PM (5 years ago)
Author:
Wenson Hsieh
Message:

[ iOS ] fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=228672
rdar://81348960

Reviewed by Simon Fraser.

On rare occasion, this test times out when the synthesized swipe gesture fails to cause the scrollable overflow
container to scroll past an arbitrary scroll position threshold (previously 400px). Mitigate this by rewriting
the test, such that we'll swipe _until_ we scroll past the threshold (which has also been lowered to just
100px).

Additionally, rewrite parts of this test to be generally easier to follow; for example, remove the scroll event
listener and instead just synthesize swipe gestures until scroller.scrollTop crosses 100px.

  • fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body-expected.txt:
  • fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html:
  • platform/ios-wk2/TestExpectations: Remove the failing test expectation.
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280932 r280937  
     12021-08-11  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [ iOS ] fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=228672
     5        rdar://81348960
     6
     7        Reviewed by Simon Fraser.
     8
     9        On rare occasion, this test times out when the synthesized swipe gesture fails to cause the scrollable overflow
     10        container to scroll past an arbitrary scroll position threshold (previously 400px). Mitigate this by rewriting
     11        the test, such that we'll swipe _until_ we scroll past the threshold (which has also been lowered to just
     12        100px).
     13
     14        Additionally, rewrite parts of this test to be generally easier to follow; for example, remove the scroll event
     15        listener and instead just synthesize swipe gestures until `scroller.scrollTop` crosses 100px.
     16
     17        * fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body-expected.txt:
     18        * fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html:
     19        * platform/ios-wk2/TestExpectations: Remove the failing test expectation.
     20
    1212021-08-11  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/LayoutTests/fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body-expected.txt

    r248433 r280937  
    1 Verifies that tapping outside of a subscrollable region during momentum scrolling dispatches click events. To run the test manually, swipe up on the black box to scroll it; while scrolling, tap outside of the scrollable area. The page should observe click events.
     1Tap here
     2Verifies that tapping outside of a subscrollable region during momentum scrolling dispatches click events. To run the test manually, swipe up on the black box to scroll it; while scrolling, tap the red box and verify that a click event is dispatched.
    23
    34On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    45
    56
    6 PASS scroller.scrollTop passed 400
    7 PASS Observed click event.
     7PASS scrolled to minimum threshold
     8PASS observedClick is true
    89PASS successfullyParsed is true
    910
  • trunk/LayoutTests/fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html

    r269360 r280937  
    1515#scroller {
    1616    width: 100%;
    17     height: 50%;
     17    height: 250px;
    1818    overflow: scroll;
    1919    border: 4px solid black;
     
    3030
    3131#target {
    32     width: 100%;
    33     height: 50px;
    34     margin-top: 1em;
     32    width: 100px;
     33    height: 100px;
     34    margin-top: 50px;
     35    background-color: tomato;
     36    color: white;
     37    line-height: 100px;
     38    text-align: center;
    3539}
    3640</style>
     
    3943        <div id="content"></div>
    4044    </div>
    41     <div id="target"></div>
     45    <div id="target">Tap here</div>
    4246    <p id="description"></p>
    4347    <p id="console"></p>
     
    4549<script>
    4650jsTestIsAsync = true;
     51observedClick = false;
    4752
    48 let reachedMinimumScrollPosition = false;
    49 const minimumExpectedScrollTop = 400;
     53const minimumExpectedScrollTop = 100;
    5054const scroller = document.getElementById("scroller");
    51 
    52 scroller.addEventListener("scroll", observeScrollEvent);
    53 document.body.addEventListener("click", () => {
    54     testPassed("Observed click event.");
    55     noteTestProgress();
    56 }, { once: true });
    57 
    58 function noteTestProgress() {
    59     if (!window.progress)
    60         progress = 0;
    61     if (++progress == 3)
    62         finishJSTest();
    63 }
    64 
    65 async function observeScrollEvent() {
    66     if (!window.testRunner || scroller.scrollTop < minimumExpectedScrollTop || reachedMinimumScrollPosition)
    67         return;
    68 
    69     reachedMinimumScrollPosition = true;
    70     testPassed(`scroller.scrollTop passed ${minimumExpectedScrollTop}`);
    71     removeEventListener("scroll", observeScrollEvent);
    72     await UIHelper.activateElement(document.getElementById("target"));
    73     noteTestProgress();
    74 }
    75 
     55const target = document.getElementById("target");
    7656async function runTest()
    7757{
    78     description("Verifies that tapping outside of a subscrollable region during momentum scrolling dispatches click events. To run the test manually, swipe up on the black box to scroll it; while scrolling, tap outside of the scrollable area. The page should observe click events.");
     58    target.addEventListener("click", () => observedClick = true);
    7959
    80     if (!window.testRunner)
    81         return;
     60    description("Verifies that tapping outside of a subscrollable region during momentum scrolling dispatches click events. To run the test manually, swipe up on the black box to scroll it; while scrolling, tap the red box and verify that a click event is dispatched.");
    8261
    83     await UIHelper.dragFromPointToPoint(160, 200, 160, 50, 0.1);
    84     noteTestProgress();
     62    while (scroller.scrollTop < minimumExpectedScrollTop) {
     63        if (window.testRunner)
     64            await UIHelper.dragFromPointToPoint(250, 200, 250, 20, 0.1);
     65        await UIHelper.delayFor(200);
     66    }
     67
     68    testPassed("scrolled to minimum threshold");
     69
     70    if (window.testRunner)
     71        await UIHelper.activateElement(target);
     72
     73    shouldBe("observedClick", "true");
     74    finishJSTest();
    8575}
    8676</script>
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r280794 r280937  
    18511851webkit.org/b/214598 fast/scrolling/ios/autoscroll-input-when-very-zoomed.html [ Pass Failure ]
    18521852
    1853 webkit.org/b/228672 fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html [ Pass Timeout ]
    1854 
    18551853http/tests/in-app-browser-privacy/ [ Pass ]
    18561854
Note: See TracChangeset for help on using the changeset viewer.