haikuwebkit/Source/WebDriver/Actions.h

81 lines
2.5 KiB
C
Raw Permalink Normal View History

WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
/*
* Copyright (C) 2018 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <wtf/text/WTFString.h>
namespace WebDriver {
enum class MouseButton { None, Left, Middle, Right };
enum class PointerType { Mouse, Pen, Touch };
struct InputSource {
WebDriver: add support for wheel actions https://bugs.webkit.org/show_bug.cgi?id=217174 Reviewed by Brian Burg. .: Enable WEBDRIVER_WHEEL_INTERACTIONS for GTK and WPE ports. * Source/cmake/OptionsGTK.cmake: * Source/cmake/OptionsWPE.cmake: * Source/cmake/WebKitFeatures.cmake: Source/WebDriver: Handle wheel actions. * Actions.h: * Session.cpp: (WebDriver::automationSourceType): Handle InputSource::Type::Wheel. (WebDriver::Session::performActions): Handle Action::Type::Wheel. * WebDriverService.cpp: (WebDriver::processKeyAction): Assert if Action::Subtype::Scroll. (WebDriver::processPointerMoveAction): Move this code to a helper to be used by both pointer move and scroll actions. (WebDriver::processPointerAction): Use processPointerMoveAction(). (WebDriver::processWheelAction): Call processPointerMoveAction() and process the scroll delta too. (WebDriver::processInputActionSequence): Handle InputSource::Type::Wheel. Source/WebKit: * UIProcess/Automation/Automation.json: Add scroll delta to action state. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputSourceState::emptyStateForSourceType): Initialize scrollDelta for wheel actions. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Handle SimulatedInputSourceType::Wheel. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): Add SimulatedInputSourceType::Wheel. (WebKit::WebAutomationSession::terminate): Handle pending wheel events. (WebKit::WebAutomationSession::willShowJavaScriptDialog): Ditto. (WebKit::WebAutomationSession::wheelEventsFlushedForPage): Ditto. (WebKit::WebAutomationSession::willClosePage): Ditto. (WebKit::WebAutomationSession::isSimulatingUserInteraction const): Return true if there are pending wheel events too. (WebKit::WebAutomationSession::simulateWheelInteraction): Handle the wheel action. (WebKit::simulatedInputSourceTypeFromProtocolSourceType): Handle Inspector::Protocol::Automation::InputSourceType::Wheel. (WebKit::WebAutomationSession::performInteractionSequence): Initialize the scroll delta for wheel action. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::WebAutomationSession::platformSimulateWheelInteraction): Synthesize a wheel event. * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: (WebKit::WebAutomationSession::platformSimulateWheelInteraction): Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isProcessingWheelEvents const): Return whether page has pending wheel events. (WebKit::WebPageProxy::didReceiveEvent): Notify automation that pending wheel events have been processed. * UIProcess/WebPageProxy.h: * config.h: Tools: Add webdriver-wheel-interactions option. * Scripts/webkitperl/FeatureList.pm: WebDriverTests: Remove expectations for wheel actions test. * TestExpectations.json: Canonical link: https://commits.webkit.org/230734@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-21 12:36:18 +00:00
enum class Type { None, Key, Pointer, Wheel };
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
Type type;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<PointerType> pointerType;
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
};
struct PointerParameters {
PointerType pointerType { PointerType::Mouse };
};
struct PointerOrigin {
enum class Type { Viewport, Pointer, Element };
Type type;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<String> elementID;
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
};
struct Action {
WebDriver: add support for wheel actions https://bugs.webkit.org/show_bug.cgi?id=217174 Reviewed by Brian Burg. .: Enable WEBDRIVER_WHEEL_INTERACTIONS for GTK and WPE ports. * Source/cmake/OptionsGTK.cmake: * Source/cmake/OptionsWPE.cmake: * Source/cmake/WebKitFeatures.cmake: Source/WebDriver: Handle wheel actions. * Actions.h: * Session.cpp: (WebDriver::automationSourceType): Handle InputSource::Type::Wheel. (WebDriver::Session::performActions): Handle Action::Type::Wheel. * WebDriverService.cpp: (WebDriver::processKeyAction): Assert if Action::Subtype::Scroll. (WebDriver::processPointerMoveAction): Move this code to a helper to be used by both pointer move and scroll actions. (WebDriver::processPointerAction): Use processPointerMoveAction(). (WebDriver::processWheelAction): Call processPointerMoveAction() and process the scroll delta too. (WebDriver::processInputActionSequence): Handle InputSource::Type::Wheel. Source/WebKit: * UIProcess/Automation/Automation.json: Add scroll delta to action state. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputSourceState::emptyStateForSourceType): Initialize scrollDelta for wheel actions. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Handle SimulatedInputSourceType::Wheel. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): Add SimulatedInputSourceType::Wheel. (WebKit::WebAutomationSession::terminate): Handle pending wheel events. (WebKit::WebAutomationSession::willShowJavaScriptDialog): Ditto. (WebKit::WebAutomationSession::wheelEventsFlushedForPage): Ditto. (WebKit::WebAutomationSession::willClosePage): Ditto. (WebKit::WebAutomationSession::isSimulatingUserInteraction const): Return true if there are pending wheel events too. (WebKit::WebAutomationSession::simulateWheelInteraction): Handle the wheel action. (WebKit::simulatedInputSourceTypeFromProtocolSourceType): Handle Inspector::Protocol::Automation::InputSourceType::Wheel. (WebKit::WebAutomationSession::performInteractionSequence): Initialize the scroll delta for wheel action. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::WebAutomationSession::platformSimulateWheelInteraction): Synthesize a wheel event. * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: (WebKit::WebAutomationSession::platformSimulateWheelInteraction): Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isProcessingWheelEvents const): Return whether page has pending wheel events. (WebKit::WebPageProxy::didReceiveEvent): Notify automation that pending wheel events have been processed. * UIProcess/WebPageProxy.h: * config.h: Tools: Add webdriver-wheel-interactions option. * Scripts/webkitperl/FeatureList.pm: WebDriverTests: Remove expectations for wheel actions test. * TestExpectations.json: Canonical link: https://commits.webkit.org/230734@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-21 12:36:18 +00:00
enum class Type { None, Key, Pointer, Wheel };
enum class Subtype { Pause, PointerUp, PointerDown, PointerMove, PointerCancel, KeyUp, KeyDown, Scroll };
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
Action(const String& id, Type type, Subtype subtype)
: id(id)
, type(type)
, subtype(subtype)
{
}
String id;
Type type;
Subtype subtype;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<unsigned> duration;
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<PointerType> pointerType;
std::optional<MouseButton> button;
std::optional<PointerOrigin> origin;
std::optional<int64_t> x;
std::optional<int64_t> y;
std::optional<int64_t> deltaX;
std::optional<int64_t> deltaY;
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<String> key;
WebDriver: implement advance user interactions https://bugs.webkit.org/show_bug.cgi?id=174616 Reviewed by Brian Burg. Source/WebDriver: Add initial implementation of action commands. * Actions.h: Added. (WebDriver::Action::Action): * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle MoveTargetOutOfBounds error. (WebDriver::CommandResult::httpStatusCode const): Ditto. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::webElementIdentifier): Helper to return the web element id. (WebDriver::Session::createElement): Use webElementIdentifier(). (WebDriver::Session::extractElementID): Ditto. (WebDriver::Session::virtualKeyForKeySequence): Add more kay codes includes in the spec. (WebDriver::mouseButtonForAutomation): Helper to get the mouse button string to pass to automation. (WebDriver::Session::performMouseInteraction): Use mouseButtonForAutomation(). (WebDriver::Session::getOrCreateInputSource): Ensure an input source for given id and add it to the active input sources. (WebDriver::Session::inputSourceState): Return the current input source state for the given id. (WebDriver::Session::computeInViewCenterPointOfElements): Get the in view center point for the list of elements given. (WebDriver::automationSourceType): Helper to get the input source type to pass to automation. (WebDriver::Session::performActions): Process the list of action by tick and generate a list of states to pass to automation. (WebDriver::Session::releaseActions): Reset input sources and state table and send a message to automation. * Session.h: * WebDriverService.cpp: (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::actionMouseButton): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::releaseActions): * WebDriverService.h: Source/WebKit: Handle origin in case of mouse move transitions. * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the node in the current browsing context. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location. (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current location and mouse move origin. (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions. (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID. (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with viewportInViewCenterPointOfElement() callbacks. (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd or even number. (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks. (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle. (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSessionMacros.h: WebDriverTests: Update test expectations. * TestExpectations.json: Canonical link: https://commits.webkit.org/200988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-10 06:52:31 +00:00
};
} // WebDriver