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

Unified Diff: chrome/test/webdriver/webdriver_session.cc

Issue 9288051: Implement the webdriver window sizing commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 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/webdriver/webdriver_session.h ('k') | chrome/test/webdriver/webdriver_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_session.cc
diff --git a/chrome/test/webdriver/webdriver_session.cc b/chrome/test/webdriver/webdriver_session.cc
index 060afe21b283153800923efbd01cbc4fea80e0cc..2d26c8aedc654e7ed1b2902944584353cebf2858 100644
--- a/chrome/test/webdriver/webdriver_session.cc
+++ b/chrome/test/webdriver/webdriver_session.cc
@@ -770,6 +770,37 @@ Error* Session::CloseWindow() {
return error;
}
+Error* Session::GetWindowBounds(const WebViewId& window, Rect* bounds) {
+ const char* kGetWindowBoundsScript =
+ "function() {"
+ " return {"
+ " 'left': window.screenX,"
+ " 'top': window.screenY,"
+ " 'width': window.outerWidth,"
+ " 'height': window.outerHeight"
+ " }"
+ "}";
+ return ExecuteScriptAndParse(
+ FrameId(window, FramePath()),
+ kGetWindowBoundsScript,
+ "getWindowBoundsScript",
+ new ListValue(),
+ CreateDirectValueParser(bounds));
+}
+
+Error* Session::SetWindowBounds(
+ const WebViewId& window,
+ const Rect& bounds) {
+ Error* error = NULL;
+ RunSessionTask(base::Bind(
+ &Automation::SetViewBounds,
+ base::Unretained(automation_.get()),
+ window,
+ bounds,
+ &error));
+ return error;
+}
+
Error* Session::GetAlertMessage(std::string* text) {
Error* error = NULL;
RunSessionTask(base::Bind(
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | chrome/test/webdriver/webdriver_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698