Title: [256657] trunk/LayoutTests
Revision
256657
Author
commit-qu...@webkit.org
Date
2020-02-14 17:01:04 -0800 (Fri, 14 Feb 2020)

Log Message

Fix flaky tests that scroll before first paint
https://bugs.webkit.org/show_bug.cgi?id=207780

After https://bugs.webkit.org/show_bug.cgi?id=207516, a couple of tests are now flaky. This
is because that patch delays first paint until there is enough content to render, and some
of these tests are issuing scroll events on controls before those controls render. To fix
this, we delay issuing the events until after the page loads.

Patch by Ben Nham <n...@apple.com> on 2020-02-14
Reviewed by Simon Fraser.

* fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
* fast/scrolling/scroll-container-horizontally.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256656 => 256657)


--- trunk/LayoutTests/ChangeLog	2020-02-14 23:51:30 UTC (rev 256656)
+++ trunk/LayoutTests/ChangeLog	2020-02-15 01:01:04 UTC (rev 256657)
@@ -1,3 +1,18 @@
+2020-02-14  Ben Nham  <n...@apple.com>
+
+        Fix flaky tests that scroll before first paint
+        https://bugs.webkit.org/show_bug.cgi?id=207780
+
+        After https://bugs.webkit.org/show_bug.cgi?id=207516, a couple of tests are now flaky. This
+        is because that patch delays first paint until there is enough content to render, and some
+        of these tests are issuing scroll events on controls before those controls render. To fix
+        this, we delay issuing the events until after the page loads.
+
+        Reviewed by Simon Fraser.
+
+        * fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
+        * fast/scrolling/scroll-container-horizontally.html:
+
 2020-02-14  Truitt Savell  <tsav...@apple.com>
 
         [ Mac wk2 ] fast/html/marquee-child-wrap.html is flaky failing.

Modified: trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html (256656 => 256657)


--- trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	2020-02-14 23:51:30 UTC (rev 256656)
+++ trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	2020-02-15 01:01:04 UTC (rev 256657)
@@ -13,7 +13,7 @@
 </div>
 
 <script>
-    (function() {
+    window.addEventListener('load', function() {
         if (!window.testRunner) {
             debug("This test only works in the test runner.");
             return;
@@ -44,5 +44,5 @@
             eventSender.mouseMoveTo(100, 100);
             eventSender.mouseScrollBy(0, -5);
         }
-    })();
+    });
 </script>

Modified: trunk/LayoutTests/fast/scrolling/scroll-container-horizontally.html (256656 => 256657)


--- trunk/LayoutTests/fast/scrolling/scroll-container-horizontally.html	2020-02-14 23:51:30 UTC (rev 256656)
+++ trunk/LayoutTests/fast/scrolling/scroll-container-horizontally.html	2020-02-15 01:01:04 UTC (rev 256657)
@@ -22,9 +22,7 @@
   <div class=scrollable></div>
 </div>
 <script>
-  if (window.eventSender && window.testRunner) {
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
+  function runTest() {
     eventSender.monitorWheelEvents();
     // Scroll vertically to reach the bottom scrollable container.
     eventSender.mouseMoveTo(10, 499);
@@ -48,8 +46,14 @@
         document.body.innerText = !firstOffset && secondOffset ? "PASS" : "FAIL";  
         testRunner.notifyDone();
         }); 
-	});
+    });
   }
+
+  if (window.eventSender && window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+    window.addEventListener('load', runTest);
+  }
 </script>
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to