Title: [254699] trunk/Tools
Revision
254699
Author
[email protected]
Date
2020-01-16 11:27:43 -0800 (Thu, 16 Jan 2020)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (254698 => 254699)


--- trunk/Tools/ChangeLog	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/ChangeLog	2020-01-16 19:27:43 UTC (rev 254699)
@@ -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-16  Philippe Normand  <[email protected]>
 
         [GStreamer][WPE] Client-side video rendering support

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (254698 => 254699)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2020-01-16 19:27:43 UTC (rev 254699)
@@ -1086,7 +1086,8 @@
 
     setHidden(false);
 
-    platformResetStateToConsistentValues(options);
+    if (!platformResetStateToConsistentValues(options))
+        return false;
 
     m_shouldDecideNavigationPolicyAfterDelay = false;
     m_shouldDecideResponsePolicyAfterDelay = false;
@@ -3086,8 +3087,9 @@
     return context;
 }
 
-void TestController::platformResetStateToConsistentValues(const TestOptions&)
+bool TestController::platformResetStateToConsistentValues(const TestOptions&)
 {
+    return true;
 }
 
 unsigned TestController::imageCountInGeneralPasteboard() const

Modified: trunk/Tools/WebKitTestRunner/TestController.h (254698 => 254699)


--- trunk/Tools/WebKitTestRunner/TestController.h	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2020-01-16 19:27:43 UTC (rev 254699)
@@ -358,7 +358,8 @@
     void platformCreateWebView(WKPageConfigurationRef, const TestOptions&);
     static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions&);
     void platformResetPreferencesToConsistentValues();
-    void platformResetStateToConsistentValues(const TestOptions&);
+    // Returns false if the reset timed out.
+    bool platformResetStateToConsistentValues(const TestOptions&);
 #if PLATFORM(COCOA)
     void cocoaPlatformInitialize();
     void cocoaResetStateToConsistentValues(const TestOptions&);

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (254698 => 254699)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-01-16 19:27:43 UTC (rev 254699)
@@ -262,7 +262,7 @@
         [platformView resetInteractionCallbacks];
     }
 
-    [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true];
+    [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota:YES];
 }
 
 void TestController::platformWillRunTest(const TestInvocation& testInvocation)

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (254698 => 254699)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2020-01-16 19:27:43 UTC (rev 254699)
@@ -142,7 +142,7 @@
     [(__bridge WKPreferences *)preferences _setShouldIgnoreMetaViewport:NO];
 }
 
-void TestController::platformResetStateToConsistentValues(const TestOptions& options)
+bool TestController::platformResetStateToConsistentValues(const TestOptions& options)
 {
     cocoaResetStateToConsistentValues(options);
 
@@ -193,8 +193,28 @@
     runUntil(isDoneWaitingForKeyboardToDismiss, m_currentInvocation->shortTimeout());
     runUntil(isDoneWaitingForMenuToDismiss, m_currentInvocation->shortTimeout());
 
+    if (PlatformWebView* platformWebView = mainWebView()) {
+        TestRunnerWKWebView *webView = platformWebView->platformView();
+        UIViewController *webViewController = [[webView window] rootViewController];
+
+        MonotonicTime waitEndTime = MonotonicTime::now() + m_currentInvocation->shortTimeout();
+        
+        bool hasPresentedViewController = !![webViewController presentedViewController];
+        while (hasPresentedViewController && MonotonicTime::now() < waitEndTime) {
+            [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+            hasPresentedViewController = !![webViewController presentedViewController];
+        }
+        
+        if (hasPresentedViewController) {
+            TestInvocation::dumpWebProcessUnresponsiveness("TestController::platformResetPreferencesToConsistentValues - Failed to remove presented view controller\n");
+            return false;
+        }
+    }
+
     if (shouldRestoreFirstResponder)
         [mainWebView()->platformView() becomeFirstResponder];
+
+    return true;
 }
 
 void TestController::platformConfigureViewForTest(const TestInvocation& test)

Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (254698 => 254699)


--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2020-01-16 19:17:47 UTC (rev 254698)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2020-01-16 19:27:43 UTC (rev 254699)
@@ -110,7 +110,7 @@
 {
 }
 
-void TestController::platformResetStateToConsistentValues(const TestOptions& options)
+bool TestController::platformResetStateToConsistentValues(const TestOptions& options)
 {
     cocoaResetStateToConsistentValues(options);
 
@@ -117,6 +117,8 @@
     while ([NSApp nextEventMatchingMask:NSEventMaskGesture | NSEventMaskScrollWheel untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]) {
         // Clear out (and ignore) any pending gesture and scroll wheel events.
     }
+    
+    return true;
 }
 
 void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& options, const std::string&) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to