Title: [254786] trunk
Revision
254786
Author
[email protected]
Date
2020-01-17 18:22:51 -0800 (Fri, 17 Jan 2020)

Log Message

Tools:
fast/forms/ios/zoom-after-input-tap-wide-input.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=206313

Reviewed by Wenson Hsieh.

The timeout was caused by the previous test, fast/forms/ios/validation-bubble-dismiss-on-tap.html,
which puts up a validation bubble whose implementation involves showing a modal UIViewController.
That view controller disappears with an animation, which happened after we're proceeded to the next
test, and the overlay view could intercept touches thus breaking any subsequent touch-based test.

Fix by having platformResetStateToConsistentValues() wait for the presentedViewController to
go to nil, which requires spinning the runloop.

platformResetStateToConsistentValues() will return false if we fail to remove the presented view controller,
which will trigger a timeout with a log.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformResetStateToConsistentValues):

LayoutTests:
Some iOS tests using UIHelper.dragFromPointToPoint() are flakey
https://bugs.webkit.org/show_bug.cgi?id=206441

Reviewed by Wenson Hsieh.

Unskip tests.

* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (254785 => 254786)


--- trunk/LayoutTests/ChangeLog	2020-01-18 02:13:16 UTC (rev 254785)
+++ trunk/LayoutTests/ChangeLog	2020-01-18 02:22:51 UTC (rev 254786)
@@ -1,3 +1,15 @@
+2020-01-17  Simon Fraser  <[email protected]>
+
+        Some iOS tests using UIHelper.dragFromPointToPoint() are flakey
+        https://bugs.webkit.org/show_bug.cgi?id=206441
+
+        Reviewed by Wenson Hsieh.
+
+        Unskip tests.
+
+        * platform/ios-wk2/TestExpectations:
+        * platform/ios/TestExpectations:
+
 2020-01-17  Megan Gardner  <[email protected]>
 
         Use Visible Position to calculate Positions for highlights

Modified: trunk/LayoutTests/platform/ios/TestExpectations (254785 => 254786)


--- trunk/LayoutTests/platform/ios/TestExpectations	2020-01-18 02:13:16 UTC (rev 254785)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2020-01-18 02:22:51 UTC (rev 254786)
@@ -3345,10 +3345,6 @@
 fast/text/crash-complex-text-surrogate.html [ Failure ]
 fast/text/international/system-language/system-font-punctuation.html [ Failure ]
 
-# <rdar://problem/51756254>REGRESSION (r244582-r244596) Layout tests fast/scrolling/ios/touch-scroll-visibility-hidden.html fast/scrolling/ios/touch-scroll-pointer-events-none.html are failing
-fast/scrolling/ios/touch-scroll-pointer-events-none.html [ Failure ]
-fast/scrolling/ios/touch-scroll-visibility-hidden.html [ Failure ]
-
 # <rdar://problem/52962272> fast/scrolling/ios/body-overflow-hidden.html is an Image failure
 fast/scrolling/ios/body-overflow-hidden.html [ Pass ImageOnlyFailure ]
 

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (254785 => 254786)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2020-01-18 02:13:16 UTC (rev 254785)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2020-01-18 02:22:51 UTC (rev 254786)
@@ -1339,9 +1339,6 @@
 webkit.org/b/203264 [ Release ] editing/pasteboard/smart-paste-paragraph-003.html [ Pass Failure ]
 webkit.org/b/203264 [ Release ] editing/pasteboard/smart-paste-paragraph-004.html [ Pass Failure ]
 
-# <rdar://problem/56714139> (r251242) [ iOS ]: fast/scrolling/ios/touch-scroll-visibility-hidden.html is a Flaky Timeout (203577)
-webkit.org/b/203577 fast/scrolling/ios/touch-scroll-visibility-hidden.html [ Pass Timeout ]
-
 # Timeout running prompt() because mock implementation is absent.
 webkit.org/b/203572 media/remoteplayback-prompt.html [ Skip ]
 webkit.org/b/203572 media/remoteplayback-target-availability.html [ Skip ]

Modified: trunk/Tools/ChangeLog (254785 => 254786)


--- trunk/Tools/ChangeLog	2020-01-18 02:13:16 UTC (rev 254785)
+++ trunk/Tools/ChangeLog	2020-01-18 02:22:51 UTC (rev 254786)
@@ -1,3 +1,32 @@
+2020-01-16  Simon Fraser  <[email protected]>
+
+        fast/forms/ios/zoom-after-input-tap-wide-input.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=206313
+
+        Reviewed by Wenson Hsieh.
+        
+        The timeout was caused by the previous test, fast/forms/ios/validation-bubble-dismiss-on-tap.html, 
+        which puts up a validation bubble whose implementation involves showing a modal UIViewController.
+        That view controller disappears with an animation, which happened after we're proceeded to the next
+        test, and the overlay view could intercept touches thus breaking any subsequent touch-based test.
+
+        Fix by having platformResetStateToConsistentValues() wait for the presentedViewController to
+        go to nil, which requires spinning the runloop.
+
+        platformResetStateToConsistentValues() will return false if we fail to remove the presented view controller,
+        which will trigger a timeout with a log.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::TestController::platformResetStateToConsistentValues):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::cocoaResetStateToConsistentValues):
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformResetStateToConsistentValues):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformResetStateToConsistentValues):
+
 2020-01-17  Aakash Jain  <[email protected]>
 
         [EWS] Print disk space usage for windows bots
@@ -134,35 +163,6 @@
         * TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:
         (TestWebKitAPI::TEST):
 
-2020-01-16  Simon Fraser  <[email protected]>
-
-        fast/forms/ios/zoom-after-input-tap-wide-input.html is timing out
-        https://bugs.webkit.org/show_bug.cgi?id=206313
-
-        Reviewed by Wenson Hsieh.
-        
-        The timeout was caused by the previous test, fast/forms/ios/validation-bubble-dismiss-on-tap.html, 
-        which puts up a validation bubble whose implementation involves showing a modal UIViewController.
-        That view controller disappears with an animation, which happened after we're proceeded to the next
-        test, and the overlay view could intercept touches thus breaking any subsequent touch-based test.
-
-        Fix by having platformResetStateToConsistentValues() wait for the presentedViewController to
-        go to nil, which requires spinning the runloop.
-
-        platformResetStateToConsistentValues() will return false if we fail to remove the presented view controller,
-        which will trigger a timeout with a log.
-
-        * WebKitTestRunner/TestController.cpp:
-        (WTR::TestController::resetStateToConsistentValues):
-        (WTR::TestController::platformResetStateToConsistentValues):
-        * WebKitTestRunner/TestController.h:
-        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
-        (WTR::TestController::cocoaResetStateToConsistentValues):
-        * WebKitTestRunner/ios/TestControllerIOS.mm:
-        (WTR::TestController::platformResetStateToConsistentValues):
-        * WebKitTestRunner/mac/TestControllerMac.mm:
-        (WTR::TestController::platformResetStateToConsistentValues):
-
 2020-01-16  Philippe Normand  <[email protected]>
 
         [GStreamer][WPE] Client-side video rendering support
@@ -247,6 +247,27 @@
         * Scripts/webkitpy/api_tests/manager.py:
         (Manager._find_test_subset):
 
+2020-01-17  Simon Fraser  <[email protected]>
+
+        Some iOS tests using UIHelper.dragFromPointToPoint() are flakey
+        https://bugs.webkit.org/show_bug.cgi?id=206441
+        rdar://problem/56714139
+
+        Reviewed by Wenson Hsieh.
+
+        The way that HIDEventGenerator sends all the generated events in a blocking loop seems to
+        trigger an issue where the events, when received by the scroll view gesture recognizers,
+        don't actually trigger a scroll.
+
+        Attempt to fix by creating an event stream in UIScriptControllerIOS::dragFromPointToPoint,
+        and dispatching via -[HIDEventGenerator sendEventStream:completionBlock:]. This spawns a
+        thread to dispatch the events, which will hopefully be closer to user behavior and more
+        reliably trigger the gesture recognizer.
+
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::dictionaryForFingerEventWithContentPoint):
+        (WTR::UIScriptControllerIOS::dragFromPointToPoint):
+
 2020-01-15  David Kilzer  <[email protected]>
 
         Enable -Wconditional-uninitialized in DumpRenderTree, WebKitTestRunner

Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (254785 => 254786)


--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2020-01-18 02:13:16 UTC (rev 254785)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2020-01-18 02:22:51 UTC (rev 254786)
@@ -431,18 +431,56 @@
     [[HIDEventGenerator sharedHIDEventGenerator] sendEventStream:eventInfo completionBlock:completion.get()];
 }
 
+static NSDictionary *dictionaryForFingerEventWithContentPoint(CGPoint point, NSString* phase, Seconds timeOffset)
+{
+    return @{
+        HIDEventCoordinateSpaceKey : HIDEventCoordinateSpaceTypeContent,
+        HIDEventTimeOffsetKey : @(timeOffset.seconds()),
+        HIDEventInputType : HIDEventInputTypeHand,
+        HIDEventTouchesKey : @[
+            @{
+                HIDEventTouchIDKey : @1,
+                HIDEventInputType : HIDEventInputTypeFinger,
+                HIDEventPhaseKey : phase,
+                HIDEventXKey : @(point.x),
+                HIDEventYKey : @(point.y),
+            },
+        ],
+    };
+}
+
 void UIScriptControllerIOS::dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, JSValueRef callback)
 {
     unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
-
+    
     CGPoint startPoint = globalToContentCoordinates(webView(), startX, startY);
     CGPoint endPoint = globalToContentCoordinates(webView(), endX, endY);
-    
-    [[HIDEventGenerator sharedHIDEventGenerator] dragWithStartPoint:startPoint endPoint:endPoint duration:durationSeconds completionBlock:makeBlockPtr([this, strongThis = makeRef(*this), callbackID] {
+
+    NSDictionary *touchDownInfo = dictionaryForFingerEventWithContentPoint(startPoint, HIDEventPhaseBegan, 0_s);
+    NSDictionary *interpolatedEvents = @{
+        HIDEventInterpolateKey : HIDEventInterpolationTypeLinear,
+        HIDEventCoordinateSpaceKey : HIDEventCoordinateSpaceTypeContent,
+        HIDEventTimestepKey : @(0.016),
+        HIDEventStartEventKey : dictionaryForFingerEventWithContentPoint(startPoint, HIDEventPhaseMoved, 0_s),
+        HIDEventEndEventKey : dictionaryForFingerEventWithContentPoint(endPoint, HIDEventPhaseMoved, Seconds(durationSeconds)),
+    };
+    NSDictionary *liftUpInfo = dictionaryForFingerEventWithContentPoint(endPoint, HIDEventPhaseEnded, Seconds(durationSeconds));
+
+    NSDictionary *eventStream = @{
+        TopLevelEventInfoKey : @[
+            touchDownInfo,
+            interpolatedEvents,
+            liftUpInfo,
+        ],
+    };
+
+    auto completion = makeBlockPtr([this, protectedThis = makeRefPtr(*this), callbackID] {
         if (!m_context)
             return;
         m_context->asyncTaskComplete(callbackID);
-    }).get()];
+    });
+
+    [[HIDEventGenerator sharedHIDEventGenerator] sendEventStream:eventStream completionBlock:completion.get()];
 }
     
 void UIScriptControllerIOS::longPressAtPoint(long x, long y, JSValueRef callback)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to