Fix flakey test fast/events/autoscroll-when-input-is-offscreen.html
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 04:00:05 +0000 (04:00 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 04:00:05 +0000 (04:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197897
<rdar://problem/50306931>

Reviewed by Wenson Hsieh.

Programmatic scrolls are included in the transaction and we want to
ensure that they've been applied. Then we can be sure that the page
has finished scrolling and it's appropriate to test the page offset.

* fast/events/autoscroll-when-input-is-offscreen.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/events/autoscroll-when-input-is-offscreen.html

index cc5f45a..8d7e3b1 100644 (file)
@@ -1,3 +1,17 @@
+2019-05-14  Megan Gardner  <megan_gardner@apple.com>
+
+        Fix flakey test fast/events/autoscroll-when-input-is-offscreen.html
+        https://bugs.webkit.org/show_bug.cgi?id=197897
+        <rdar://problem/50306931>
+
+        Reviewed by Wenson Hsieh.
+
+        Programmatic scrolls are included in the transaction and we want to 
+        ensure that they've been applied. Then we can be sure that the page 
+        has finished scrolling and it's appropriate to test the page offset. 
+
+        * fast/events/autoscroll-when-input-is-offscreen.html:
+
 2019-05-14  Shawn Roberts  <sroberts@apple.com>
 
         storage/indexeddb/modern/deletedatabase-2-private.html is a flaky failure
index 1592f00..e816c6e 100644 (file)
         await UIHelper.setHardwareKeyboardAttached(false);
         await UIHelper.activateElementAndWaitForInputSession(document.getElementById('editable'));
         
-        var programaticScroll = 500;
-        document.scrollingElement.scrollTop = programaticScroll;
+        var programmaticScroll = 500;
+        document.scrollingElement.scrollTop = programmaticScroll;
         await UIHelper.enterText("Test");
-
-        if (window.pageYOffset < programaticScroll)
+        await UIHelper.ensurePresentationUpdate();
+        if (window.pageYOffset < programmaticScroll)
             output += 'PASS: page has scrolled back to the top to show the element that has text being entered into it.';
         else
             output += 'FAIL: page has failed to scroll when entering text into a form that is offscreen.';