Title: [243281] trunk/LayoutTests
Revision
243281
Author
[email protected]
Date
2019-03-21 01:25:18 -0700 (Thu, 21 Mar 2019)

Log Message

Use immediateScrollElementAtContentPointToOffset for scroll overlap tests
https://bugs.webkit.org/show_bug.cgi?id=195943

Reviewed by Simon Fraser.

This is much faster and simpler than simulated touch events.

* fast/scrolling/ios/overflow-scroll-overlap-2.html:
* fast/scrolling/ios/overflow-scroll-overlap-3.html:
* fast/scrolling/ios/overflow-scroll-overlap-4.html:
* fast/scrolling/ios/overflow-scroll-overlap.html:

This API doesn't respect touch-action property, so stop using it. Instead restore
the main scrollview to the initial position explicitly after scroll.

* fast/scrolling/resources/overflow-scroll-overlap.js:
(async.runTest):
* resources/ui-helper.js:
(return.new.Promise.):
(return.new.Promise):

Add a Promise returning helper.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243280 => 243281)


--- trunk/LayoutTests/ChangeLog	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/ChangeLog	2019-03-21 08:25:18 UTC (rev 243281)
@@ -1,3 +1,28 @@
+2019-03-21  Antti Koivisto  <[email protected]>
+
+        Use immediateScrollElementAtContentPointToOffset for scroll overlap tests
+        https://bugs.webkit.org/show_bug.cgi?id=195943
+
+        Reviewed by Simon Fraser.
+
+        This is much faster and simpler than simulated touch events.
+
+        * fast/scrolling/ios/overflow-scroll-overlap-2.html:
+        * fast/scrolling/ios/overflow-scroll-overlap-3.html:
+        * fast/scrolling/ios/overflow-scroll-overlap-4.html:
+        * fast/scrolling/ios/overflow-scroll-overlap.html:
+
+        This API doesn't respect touch-action property, so stop using it. Instead restore
+        the main scrollview to the initial position explicitly after scroll.
+
+        * fast/scrolling/resources/overflow-scroll-overlap.js:
+        (async.runTest):
+        * resources/ui-helper.js:
+        (return.new.Promise.):
+        (return.new.Promise):
+
+        Add a Promise returning helper.
+
 2019-03-20  Youenn Fablet  <[email protected]>
 
         Compute quota after network process restart based on default quota and space used

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html (243280 => 243281)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2.html	2019-03-21 08:25:18 UTC (rev 243281)
@@ -2,10 +2,9 @@
 <html>
 <head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script src=""
 <style>
-body {
-    touch-action: none;
-}
 .case {
     width: 200px;
     height: 200px;
@@ -56,8 +55,6 @@
     white-space: pre;
 }
 </style>
-<script src=""
-<script src=""
 </head>
 <body _onload_="runTest()">
 <p>

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html (243280 => 243281)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html	2019-03-21 08:25:18 UTC (rev 243281)
@@ -2,10 +2,9 @@
 <html>
 <head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script src=""
 <style>
-body {
-    touch-action: none;
-}
 .case {
     width: 200px;
     height: 200px;
@@ -48,8 +47,6 @@
     white-space: pre;
 }
 </style>
-<script src=""
-<script src=""
 </head>
 <body _onload_="runTest()">
 <p>

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html (243280 => 243281)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-4.html	2019-03-21 08:25:18 UTC (rev 243281)
@@ -2,10 +2,9 @@
 <html>
 <head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script src=""
 <style>
-body {
-    touch-action: none;
-}
 .case {
     width: 200px;
     height: 200px;
@@ -48,8 +47,6 @@
     white-space: pre;
 }
 </style>
-<script src=""
-<script src=""
 </head>
 <body _onload_="runTest()">
 <p>

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html (243280 => 243281)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap.html	2019-03-21 08:25:18 UTC (rev 243281)
@@ -2,10 +2,9 @@
 <html>
 <head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script src=""
 <style>
-body {
-    touch-action: none;
-}
 .case {
     width: 150px;
     height: 150px;
@@ -48,8 +47,6 @@
     white-space: pre;
 }
 </style>
-<script src=""
-<script src=""
 </head>
 <body _onload_="runTest()">
 <p>

Modified: trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js (243280 => 243281)


--- trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js	2019-03-21 08:25:18 UTC (rev 243281)
@@ -46,10 +46,13 @@
             const rect = target.getBoundingClientRect();
             const centerX = (rect.left + rect.right) / 2;
             const centerY = (rect.top + rect.bottom) / 2;
-            await touchAndDragFromPointToPoint(centerX, centerY, centerX, centerY - 30);
-            await liftUpAtPoint(centerX, centerY - 30);
-            await sleep(500);
+            await UIHelper.immediateScrollElementAtContentPointToOffset(centerX, centerY, 0, 30);
+            
+            // Restore the main scroll view to the original position in case it moved.
+            await UIHelper.immediateScrollElementAtContentPointToOffset(5, 5, 0, 0);
 
+            await UIHelper.ensurePresentationUpdate();
+
             testcase.style.display = 'none';
             outputCase(i);
         }

Modified: trunk/LayoutTests/resources/ui-helper.js (243280 => 243281)


--- trunk/LayoutTests/resources/ui-helper.js	2019-03-21 07:51:12 UTC (rev 243280)
+++ trunk/LayoutTests/resources/ui-helper.js	2019-03-21 08:25:18 UTC (rev 243281)
@@ -286,6 +286,17 @@
         });
     }
 
+    static immediateScrollElementAtContentPointToOffset(x, y, scrollX, scrollY)
+    {
+        if (!this.isWebKit2())
+            return Promise.resolve();
+
+        return new Promise(resolve => {
+            testRunner.runUIScript(`
+                uiController.immediateScrollElementAtContentPointToOffset(${x}, ${y}, ${scrollX}, ${scrollY});`, resolve);
+        });
+    }
+
     static ensureVisibleContentRectUpdate()
     {
         if (!this.isWebKit2())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to