Web Automation: key actions should support multiple pressed virtual keys
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jun 2018 19:17:09 +0000 (19:17 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jun 2018 19:17:09 +0000 (19:17 +0000)
commita79ba0383d6ac09c9fab320c31a54d2bd4bf0900
treed4fe005e3292045f6faedfb7e11429fbeed80f74
parentcc2fa486c3fe5676d2f947db37ff234540cd6ebf
Web Automation: key actions should support multiple pressed virtual keys
https://bugs.webkit.org/show_bug.cgi?id=186899
<rdar://problem/38222248>

Reviewed by Timothy Hatcher.

Source/WebDriver:

Adopt new protocol command argument types.

* Session.cpp:
(WebDriver::Session::performActions):

Source/WebKit:

This patch changes the protocol to allow multiple virtual keys per input source state.
Chords like Cmd-Shift-A and Shift-F12 must be represented this way as they are encoded
in the VirtualKey enum rather than as an ASCII char.

* UIProcess/Automation/Automation.json:
* UIProcess/Automation/SimulatedInputDispatcher.h:
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::simulateKeyboardInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::performInteractionSequence):

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
Also clean up the signature of WebAutomationSession::platformSimulateKeyboardInteraction
to use a variant instead of mutually exclusive optional values with different types.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebDriver/ChangeLog
Source/WebDriver/Session.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Automation/Automation.json
Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp
Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.h
Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp
Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm
Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm