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

Unified Diff: chrome/test/chromedriver/element_util.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
« no previous file with comments | « chrome/test/chromedriver/element_util.h ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/element_util.cc
diff --git a/chrome/test/chromedriver/element_util.cc b/chrome/test/chromedriver/element_util.cc
index 9f02b4956cd43e6aef989d993487bdafaf12c483..e8714d3d33ef980e43ef819db7bf1560e687bc5e 100644
--- a/chrome/test/chromedriver/element_util.cc
+++ b/chrome/test/chromedriver/element_util.cc
@@ -577,14 +577,21 @@ Status ScrollElementIntoView(
Session* session,
WebView* web_view,
const std::string& id,
+ const WebPoint* offset,
WebPoint* location) {
- WebSize size;
- Status status = GetElementSize(session, web_view, id, &size);
+ WebRect region;
+ Status status = GetElementRegion(session, web_view, id, &region);
stgao 2015/01/14 01:47:20 Not sure if there will be side-effect on screensho
samuong 2015/01/14 04:35:05 GetElementRegion gets a WebRect (i.e. both a WebPo
if (status.IsError())
return status;
- return ScrollElementRegionIntoView(
- session, web_view, id, WebRect(WebPoint(0, 0), size),
+ status = ScrollElementRegionIntoView(session, web_view, id, region,
false /* center */, std::string(), location);
+ if (status.IsError())
+ return status;
+ if (offset)
+ location->Offset(offset->x, offset->y);
+ else
+ location->Offset(region.size.width / 2, region.size.height / 2);
stgao 2015/01/14 01:47:20 It may worth a check if this change has unexpected
samuong 2015/01/14 04:35:05 I will be running some presubmits later to find as
+ return Status(kOk);
}
Status ScrollElementRegionIntoView(
« no previous file with comments | « chrome/test/chromedriver/element_util.h ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698