Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2635)

Unified Diff: chrome/test/chromedriver/window_commands.cc

Issue 848483002: [chromedriver] Use center of first ClientRect when moving mouse to an element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add some extra checks to testMoveToElementAndClick Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/window_commands.cc
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc
index 8a62f896d254f1369b267d6aa464c025cc20bf4f..9a3c40512fa32d40afa8c6e46dcc08131266fa7d 100644
--- a/chrome/test/chromedriver/window_commands.cc
+++ b/chrome/test/chromedriver/window_commands.cc
@@ -470,22 +470,15 @@ Status ExecuteMouseMoveTo(
WebPoint location;
if (has_element) {
- Status status = ScrollElementIntoView(
- session, web_view, element_id, &location);
+ WebPoint offset(x_offset, y_offset);
+ Status status = ScrollElementIntoView(session, web_view, element_id,
+ has_offset ? &offset : nullptr, &location);
if (status.IsError())
return status;
} else {
location = session->mouse_position;
- }
-
- if (has_offset) {
- location.Offset(x_offset, y_offset);
- } else {
- WebSize size;
- Status status = GetElementSize(session, web_view, element_id, &size);
- if (status.IsError())
- return status;
- location.Offset(size.width / 2, size.height / 2);
+ if (has_offset)
+ location.Offset(x_offset, y_offset);
}
std::list<MouseEvent> events;

Powered by Google App Engine
This is Rietveld 408576698