Commit 4bd0cd56 authored by Jonathon Kereliuk's avatar Jonathon Kereliuk Committed by Commit Bot

[ChromeDriver] Key type actions for the actions API

This CL contains the key type actions. Follow up CLs for tests and
pointer/pause actions

spec: https://w3c.github.io/webdriver/webdriver-spec.html#actions

Bug: chromedriver:1897
Change-Id: I135df58d97a45494e51a5ac09dfce021f7d094d3
Reviewed-on: https://chromium-review.googlesource.com/692599
Commit-Queue: Jonathon Kereliuk <kereliuk@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508958}
parent a5bd9675
...@@ -32,6 +32,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) { ...@@ -32,6 +32,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) {
return "unknown error"; return "unknown error";
case kInvalidArgument: case kInvalidArgument:
return "invalid argument"; return "invalid argument";
case kMoveTargetOutOfBounds:
return "move target out of bounds";
case kElementNotInteractable: case kElementNotInteractable:
return "element not interactable"; return "element not interactable";
case kUnsupportedOperation: case kUnsupportedOperation:
......
...@@ -22,6 +22,7 @@ enum StatusCode { ...@@ -22,6 +22,7 @@ enum StatusCode {
kElementNotInteractable = 15, kElementNotInteractable = 15,
kUnsupportedOperation = 16, kUnsupportedOperation = 16,
kJavaScriptError = 17, kJavaScriptError = 17,
kMoveTargetOutOfBounds = 18,
kXPathLookupError = 19, kXPathLookupError = 19,
kUnableToSetCookie = 20, kUnableToSetCookie = 20,
kTimeout = 21, kTimeout = 21,
......
...@@ -493,9 +493,9 @@ HttpHandler::HttpHandler( ...@@ -493,9 +493,9 @@ HttpHandler::HttpHandler(
CommandMapping(kGet, "session/:sessionId/log/types", CommandMapping(kGet, "session/:sessionId/log/types",
WrapToCommand("GetLogTypes", WrapToCommand("GetLogTypes",
base::Bind(&ExecuteGetAvailableLogTypes))), base::Bind(&ExecuteGetAvailableLogTypes))),
CommandMapping(kPost, "session/:sessionId/actions", CommandMapping(
WrapToCommand("PerformActions", kPost, "session/:sessionId/actions",
base::Bind(&ExecuteUnimplementedCommand))), WrapToCommand("PerformActions", base::Bind(&ExecutePerformActions))),
CommandMapping(kDelete, "session/:sessionId/actions", CommandMapping(kDelete, "session/:sessionId/actions",
WrapToCommand("DeleteActions", WrapToCommand("DeleteActions",
base::Bind(&ExecuteUnimplementedCommand))), base::Bind(&ExecuteUnimplementedCommand))),
...@@ -724,6 +724,10 @@ HttpHandler::PrepareStandardResponse( ...@@ -724,6 +724,10 @@ HttpHandler::PrepareStandardResponse(
case kJavaScriptError: case kJavaScriptError:
response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST)); response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
break; break;
case kMoveTargetOutOfBounds:
response.reset(
new net::HttpServerResponseInfo(net::HTTP_INTERNAL_SERVER_ERROR));
break;
case kNoSuchCookie: case kNoSuchCookie:
response.reset(new net::HttpServerResponseInfo(net::HTTP_NOT_FOUND)); response.reset(new net::HttpServerResponseInfo(net::HTTP_NOT_FOUND));
break; break;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h"
#include "chrome/test/chromedriver/basic_types.h" #include "chrome/test/chromedriver/basic_types.h"
#include "chrome/test/chromedriver/chrome/device_metrics.h" #include "chrome/test/chromedriver/chrome/device_metrics.h"
#include "chrome/test/chromedriver/chrome/geoposition.h" #include "chrome/test/chromedriver/chrome/geoposition.h"
...@@ -68,6 +69,12 @@ struct Session { ...@@ -68,6 +69,12 @@ struct Session {
std::unique_ptr<Chrome> chrome; std::unique_ptr<Chrome> chrome;
std::string window; std::string window;
int sticky_modifiers; int sticky_modifiers;
// List of input sources for each active input. Everytime a new input source
// is added, there must be a corresponding entry made in input_state_table.
std::unique_ptr<base::ListValue> active_input_sources;
// Map between input id and input source state for the corresponding input
// source. One entry for each item in active_input_sources
std::unique_ptr<base::DictionaryValue> input_state_table;
// List of |FrameInfo|s for each frame to the current target frame from the // List of |FrameInfo|s for each frame to the current target frame from the
// first frame element in the root document. If target frame is window.top, // first frame element in the root document. If target frame is window.top,
// this list will be empty. // this list will be empty.
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment