Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 20:12:49 +0000 (20:12 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 20:12:49 +0000 (20:12 +0000)
commit6df66b4a77e141fb1b733c4616617a0b2f8df787
treee7fb51cec581e7499ad70bddf3a59b7b2f0e4a90
parent8dd3e8e269088d847444bfc52492fb858e1d28c1
Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=190141

Reviewed by Darin Adler.

Source/WebCore:

Remove the runtime application check for WebKitTestRunner as we no longer need this
now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebKitTestRunner): Deleted.

Source/WebKit:

Directly use +[UIKeyboard isInHardwareKeyboardMode]. We will override this class method
in DumpRenderTree and WebKitTestRunner to always return NO so as to make test runs
deterministic regardless of whether a hardware keyboard is attached.

* Shared/NativeWebKeyboardEvent.h:
* Shared/ios/NativeWebKeyboardEventIOS.mm:
(WebKit::isInHardwareKeyboardMode): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

Tools:

Override +[UIKeyboard isInHardwareKeyboardMode] to always return NO so as to make test
runs deterministic regardless of whether a hardware keyboard is attached.

* DumpRenderTree/mac/DumpRenderTree.mm:
(overrideIsInHardwareKeyboardMode): Added.
(prepareConsistentTestingEnvironment):
* TestRunnerShared/spi/UIKitTestSPI.h: Forward declare SPI.
* WebKitTestRunner/ios/TestControllerIOS.mm:
(overrideIsInHardwareKeyboardMode): Added.
(WTR::TestController::platformInitialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/Shared/NativeWebKeyboardEvent.h
Source/WebKit/Shared/ios/NativeWebKeyboardEventIOS.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/TestRunnerShared/spi/UIKitTestSPI.h
Tools/WebKitTestRunner/ios/TestControllerIOS.mm