Title: [243657] trunk
Revision
243657
Author
cdu...@apple.com
Date
2019-03-29 13:11:54 -0700 (Fri, 29 Mar 2019)

Log Message

REGRESSION (r243523): Six form-related watchOS layout tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=196405
<rdar://problem/49428130>

Reviewed by Wenson Hsieh.

Tools:

Add a shouldPresentPopovers=false WebKitTestRunner option to cause WKTR to swizzle
the popover presentation methods to be no-ops. Use this in the new test added in
r243523 so that we do not swizzle those methods for all tests. This is needed because
those WatchOS tests rely on the popover getting presented and interactive.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformInitialize):
(WTR::TestController::platformResetStateToConsistentValues):

LayoutTests:

* fast/forms/ios/file-upload-panel.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243656 => 243657)


--- trunk/LayoutTests/ChangeLog	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/LayoutTests/ChangeLog	2019-03-29 20:11:54 UTC (rev 243657)
@@ -1,3 +1,13 @@
+2019-03-29  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION (r243523): Six form-related watchOS layout tests are timing out
+        https://bugs.webkit.org/show_bug.cgi?id=196405
+        <rdar://problem/49428130>
+
+        Reviewed by Wenson Hsieh.
+
+        * fast/forms/ios/file-upload-panel.html:
+
 2019-03-29  Wenson Hsieh  <wenson_hs...@apple.com>
 
         REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites

Modified: trunk/LayoutTests/fast/forms/ios/file-upload-panel.html (243656 => 243657)


--- trunk/LayoutTests/fast/forms/ios/file-upload-panel.html	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/LayoutTests/fast/forms/ios/file-upload-panel.html	2019-03-29 20:11:54 UTC (rev 243657)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true, shouldHandleRunOpenPanel=false ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true, shouldHandleRunOpenPanel=false, shouldPresentPopovers=false ] -->
 <html>
 <head>
 <meta name="viewport" content="width=device-width">

Modified: trunk/Tools/ChangeLog (243656 => 243657)


--- trunk/Tools/ChangeLog	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/Tools/ChangeLog	2019-03-29 20:11:54 UTC (rev 243657)
@@ -1,3 +1,25 @@
+2019-03-29  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION (r243523): Six form-related watchOS layout tests are timing out
+        https://bugs.webkit.org/show_bug.cgi?id=196405
+        <rdar://problem/49428130>
+
+        Reviewed by Wenson Hsieh.
+
+        Add a shouldPresentPopovers=false WebKitTestRunner option to cause WKTR to swizzle
+        the popover presentation methods to be no-ops. Use this in the new test added in
+        r243523 so that we do not swizzle those methods for all tests. This is needed because
+        those WatchOS tests rely on the popover getting presented and interactive.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::updateTestOptionsFromTestHeader):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestOptions.h:
+        (WTR::TestOptions::hasSameInitializationOptions const):
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformInitialize):
+        (WTR::TestController::platformResetStateToConsistentValues):
+
 2019-03-29  Takashi Komori  <takashi.kom...@sony.com>
 
         [Curl] Add Server Trust Evaluation Support.

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (243656 => 243657)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2019-03-29 20:11:54 UTC (rev 243657)
@@ -1346,6 +1346,8 @@
             testOptions.enableUndoManagerAPI = parseBooleanTestHeaderValue(value);
         else if (key == "shouldHandleRunOpenPanel")
             testOptions.shouldHandleRunOpenPanel = parseBooleanTestHeaderValue(value);
+        else if (key == "shouldPresentPopovers")
+            testOptions.shouldPresentPopovers = parseBooleanTestHeaderValue(value);
         else if (key == "contentInset.top")
             testOptions.contentInsetTop = std::stod(value);
         else if (key == "ignoreSynchronousMessagingTimeouts")

Modified: trunk/Tools/WebKitTestRunner/TestController.h (243656 => 243657)


--- trunk/Tools/WebKitTestRunner/TestController.h	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2019-03-29 20:11:54 UTC (rev 243657)
@@ -489,6 +489,7 @@
 #if PLATFORM(IOS_FAMILY)
     Vector<std::unique_ptr<InstanceMethodSwizzler>> m_inputModeSwizzlers;
     RetainPtr<UIKeyboardInputMode> m_overriddenKeyboardInputMode;
+    Vector<std::unique_ptr<InstanceMethodSwizzler>> m_presentPopoverSwizzlers;
 #endif
 
     enum State {

Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (243656 => 243657)


--- trunk/Tools/WebKitTestRunner/TestOptions.h	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h	2019-03-29 20:11:54 UTC (rev 243657)
@@ -90,6 +90,7 @@
     bool editable { false };
     bool enableUndoManagerAPI { false };
     bool shouldHandleRunOpenPanel { true };
+    bool shouldPresentPopovers { true };
 
     double contentInsetTop { 0 };
 
@@ -138,6 +139,7 @@
             || editable != options.editable
             || enableUndoManagerAPI != options.enableUndoManagerAPI
             || shouldHandleRunOpenPanel != options.shouldHandleRunOpenPanel
+            || shouldPresentPopovers != options.shouldPresentPopovers
             || contentInsetTop != options.contentInsetTop)
             return false;
 

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (243656 => 243657)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2019-03-29 20:09:02 UTC (rev 243656)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2019-03-29 20:11:54 UTC (rev 243657)
@@ -100,9 +100,6 @@
     // Override the implementation of +[UIKeyboard isInHardwareKeyboardMode] to ensure that test runs are deterministic
     // regardless of whether a hardware keyboard is attached. We intentionally never restore the original implementation.
     method_setImplementation(class_getClassMethod([UIKeyboard class], @selector(isInHardwareKeyboardMode)), reinterpret_cast<IMP>(overrideIsInHardwareKeyboardMode));
-
-    method_setImplementation(class_getInstanceMethod([UIViewController class], @selector(presentViewController:animated:completion:)), reinterpret_cast<IMP>(overridePresentViewControllerOrPopover));
-    method_setImplementation(class_getInstanceMethod([UIPopoverController class], @selector(presentPopoverFromRect:inView:permittedArrowDirections:animated:)), reinterpret_cast<IMP>(overridePresentViewControllerOrPopover));
 }
 
 void TestController::platformDestroy()
@@ -147,6 +144,12 @@
 
     m_inputModeSwizzlers.clear();
     m_overriddenKeyboardInputMode = nil;
+
+    m_presentPopoverSwizzlers.clear();
+    if (!options.shouldPresentPopovers) {
+        m_presentPopoverSwizzlers.append(std::make_unique<InstanceMethodSwizzler>([UIViewController class], @selector(presentViewController:animated:completion:), reinterpret_cast<IMP>(overridePresentViewControllerOrPopover)));
+        m_presentPopoverSwizzlers.append(std::make_unique<InstanceMethodSwizzler>([UIPopoverController class], @selector(presentPopoverFromRect:inView:permittedArrowDirections:animated:), reinterpret_cast<IMP>(overridePresentViewControllerOrPopover)));
+    }
     
     BOOL shouldRestoreFirstResponder = NO;
     if (PlatformWebView* platformWebView = mainWebView()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to