Title: [202304] trunk/LayoutTests
Revision
202304
Author
[email protected]
Date
2016-06-21 16:32:34 -0700 (Tue, 21 Jun 2016)

Log Message

LayoutTest tiled-drawing/scrolling/latched-div-with-scroll-snap.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=158320

Reviewed by Simon Fraser.

This test case is flaky because:
1. There are multiple mouseScrollByWithWheelAndMomentumPhases() event bundles and they all need their own
callbacks. (see additional eventSender.callAfterScrollingCompletes()) -> fail
2. When the test fails, the testFailed() function is called with undefined variables. -> timeout

* platform/mac-wk2/TestExpectations:
* tiled-drawing/scrolling/latched-div-with-scroll-snap.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202303 => 202304)


--- trunk/LayoutTests/ChangeLog	2016-06-21 23:24:37 UTC (rev 202303)
+++ trunk/LayoutTests/ChangeLog	2016-06-21 23:32:34 UTC (rev 202304)
@@ -1,3 +1,18 @@
+2016-06-21  Zalan Bujtas  <[email protected]>
+
+        LayoutTest tiled-drawing/scrolling/latched-div-with-scroll-snap.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=158320
+
+        Reviewed by Simon Fraser.
+
+        This test case is flaky because:
+        1. There are multiple mouseScrollByWithWheelAndMomentumPhases() event bundles and they all need their own
+        callbacks. (see additional eventSender.callAfterScrollingCompletes()) -> fail
+        2. When the test fails, the testFailed() function is called with undefined variables. -> timeout  
+
+        * platform/mac-wk2/TestExpectations:
+        * tiled-drawing/scrolling/latched-div-with-scroll-snap.html:
+
 2016-06-21  Jiewen Tan  <[email protected]>
 
         Unreviewed, rolling out r200619.

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (202303 => 202304)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2016-06-21 23:24:37 UTC (rev 202303)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2016-06-21 23:32:34 UTC (rev 202304)
@@ -258,8 +258,6 @@
 webkit.org/b/148408 tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html [ Pass Failure ]
 webkit.org/b/148408 tiled-drawing/scrolling/root-overflow-with-mousewheel.html [ Pass Failure Timeout ]
 
-webkit.org/b/158320 tiled-drawing/scrolling/latched-div-with-scroll-snap.html [ Pass Failure Timeout ]
-
 webkit.org/b/139820 fast/frames/lots-of-objects.html [ Timeout ]
 webkit.org/b/139820 fast/frames/lots-of-iframes.html [ Pass Timeout ]
 

Modified: trunk/LayoutTests/tiled-drawing/scrolling/latched-div-with-scroll-snap.html (202303 => 202304)


--- trunk/LayoutTests/tiled-drawing/scrolling/latched-div-with-scroll-snap.html	2016-06-21 23:24:37 UTC (rev 202303)
+++ trunk/LayoutTests/tiled-drawing/scrolling/latched-div-with-scroll-snap.html	2016-06-21 23:32:34 UTC (rev 202304)
@@ -82,6 +82,13 @@
             finishJSTest();
         }
 
+        function performSwipeGestureOnElementEnd()
+        {
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
+        }
+
         function performSwipeGestureOnElement(divTarget)
         {
             var windowPosition = locationInWindowCoordinates(divTarget);
@@ -88,6 +95,7 @@
             var startPosX = windowPosition.x + 0.5 * divTarget.clientWidth;
             var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
 
+            eventSender.monitorWheelEvents();
             eventSender.mouseMoveTo(startPosX, startPosY);
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
@@ -94,9 +102,6 @@
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
-            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin');
-            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue');
-            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
         }
 
         function scrollInSecondDiv()
@@ -109,7 +114,12 @@
 
             performSwipeGestureOnElement(divTarget);
 
-            eventSender.callAfterScrollingCompletes(function() { return checkForSecondaryScrollGlide(); });           
+            eventSender.callAfterScrollingCompletes(function() { 
+                performSwipeGestureOnElementEnd();
+                eventSender.callAfterScrollingCompletes(function() {
+                    setTimeout(function() { checkForSecondaryScrollGlide(); }, 10); 
+                });
+            });           
         }
 
         function checkForScrollSnap()
@@ -119,12 +129,13 @@
             var actualPosition = divTarget.scrollLeft;
 
             // The div should have snapped back to the previous position
-            if (actualPosition != divScrollPositionBeforeSnap)
-                testFailed("div did not snap back to proper location for " + targetLabel +". Expected " + divScrollPositionBeforeSnap + ", but got " + actualPosition);
-            else
+            if (actualPosition != divScrollPositionBeforeSnap) {
+                testFailed("div did not snap back to proper location for " + divTarget +". Expected " + divScrollPositionBeforeSnap + ", but got " + actualPosition);
+                finishJSTest();
+                return;
+            } else
                 testPassed("div honored snap points.");
-
-            setTimeout(function() { scrollInSecondDiv() }, 0);
+            scrollInSecondDiv();
         }
 
         function scrollSnapTest()
@@ -137,12 +148,13 @@
             var startPosX = windowPosition.x + 0.5 * divTarget.clientWidth;
             var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
 
+            eventSender.monitorWheelEvents();
             eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
-            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(); });
+            eventSender.callAfterScrollingCompletes(function() { checkForScrollSnap(); });
         }
 
         function checkForScrollGlide(targetLabel)
@@ -155,10 +167,12 @@
             // The div should have scrolled (glided) to the next snap point.
             if (actualPosition == expectedPosition)
                 testPassed("div scrolled to next window.");
-            else
+            else {
                 testFailed("div did not honor snap points. Expected " + expectedPosition + ", but got " + actualPosition);
-
-            setTimeout(function() { scrollSnapTest() }, 0);
+                finishJSTest();
+                return;
+            }
+            scrollSnapTest();
         }
 
         function scrollGlideTest()
@@ -168,17 +182,19 @@
             divScrollPositionBeforeGlide = divTarget.scrollLeft;
 
             performSwipeGestureOnElement(divTarget);
-    
-            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(); });
+            eventSender.callAfterScrollingCompletes(function() { 
+                performSwipeGestureOnElementEnd();
+                eventSender.callAfterScrollingCompletes(function() {
+                    setTimeout(function() { checkForScrollGlide(); }, 10); 
+                });
+            });           
         }
 
         function onLoad()
         {
             if (window.eventSender) {
-                eventSender.monitorWheelEvents();
                 testRunner.dumpAsText();
-                testRunner.waitUntilDone();
-                setTimeout(function() { scrollGlideTest() }, 0);
+                scrollGlideTest();
             } else {
                 var messageLocationH = document.getElementById('itemH0');
                 var message = document.createElement('div');
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to