Commit 72cb6c92 authored by Tatiana Buldina's avatar Tatiana Buldina Committed by Commit Bot

[ChromeDriver] Raise kElementClickIntercepted if element is overlaid

Bug: chromedriver:2773
Change-Id: I663a3a4f280f31e5428c2056d7bdfc64b0c6a048
Reviewed-on: https://chromium-review.googlesource.com/c/1482110Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tatiana Buldina <buldina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634697}
parent 4ca897d2
...@@ -74,6 +74,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) { ...@@ -74,6 +74,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) {
return "unable to set cookie"; return "unable to set cookie";
case kTargetDetached: case kTargetDetached:
return "target frame detached"; return "target frame detached";
case kElementClickIntercepted:
return "element click intercepted";
default: default:
return "<unknown>"; return "<unknown>";
} }
......
...@@ -33,6 +33,7 @@ enum StatusCode { ...@@ -33,6 +33,7 @@ enum StatusCode {
kElementNotInteractable = 60, kElementNotInteractable = 60,
kInvalidArgument = 61, kInvalidArgument = 61,
kNoSuchCookie = 62, kNoSuchCookie = 62,
kElementClickIntercepted = 64,
kUnsupportedOperation = 405, kUnsupportedOperation = 405,
// Chrome-specific status codes. // Chrome-specific status codes.
kChromeNotReachable = 100, kChromeNotReachable = 100,
......
...@@ -120,8 +120,8 @@ Status VerifyElementClickable( ...@@ -120,8 +120,8 @@ Status VerifyElementClickable(
if (!is_clickable) { if (!is_clickable) {
std::string message; std::string message;
if (!dict->GetString("message", &message)) if (!dict->GetString("message", &message))
message = "element is not clickable"; message = "element click intercepted";
return Status(kUnknownError, message); return Status(kElementClickIntercepted, message);
} }
return Status(kOk); return Status(kOk);
} }
......
...@@ -994,6 +994,9 @@ HttpHandler::PrepareStandardResponse( ...@@ -994,6 +994,9 @@ HttpHandler::PrepareStandardResponse(
response.reset(new net::HttpServerResponseInfo(net::HTTP_OK)); response.reset(new net::HttpServerResponseInfo(net::HTTP_OK));
break; break;
// error codes // error codes
case kElementClickIntercepted:
response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
break;
case kElementNotInteractable: case kElementNotInteractable:
response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST)); response.reset(new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
break; break;
......
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