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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@243281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js b/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js
index e9c4c39..1740979 100644
--- a/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js
+++ b/LayoutTests/fast/scrolling/resources/overflow-scroll-overlap.js
@@ -46,9 +46,12 @@
             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);