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

Unified Diff: chrome/test/webdriver/commands/window_commands.cc

Issue 10388251: Support maximize window command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/webdriver/commands/window_commands.cc
diff --git a/chrome/test/webdriver/commands/window_commands.cc b/chrome/test/webdriver/commands/window_commands.cc
index e799dd36a70873d2ace5f35f163cd19de0d97c01..f67500b395d9022cd692858e0c5bbe9ebcaff171 100644
--- a/chrome/test/webdriver/commands/window_commands.cc
+++ b/chrome/test/webdriver/commands/window_commands.cc
@@ -132,7 +132,7 @@ void WindowPositionCommand::ExecuteGet(Response* const response) {
}
void WindowPositionCommand::ExecutePost(Response* const response) {
- // Path segment: "/session/$sessionId/window/$windowHandle/size"
+ // Path segment: "/session/$sessionId/window/$windowHandle/position"
WebViewId window_id;
WebViewId current_id = session_->current_target().view_id;
if (!GetWindowId(GetPathVariable(4), current_id, &window_id, response))
@@ -158,4 +158,31 @@ void WindowPositionCommand::ExecutePost(Response* const response) {
}
}
+WindowMaximizeCommand::WindowMaximizeCommand(
+ const std::vector<std::string>& path_segments,
+ const base::DictionaryValue* parameters)
+ : WebDriverCommand(path_segments, parameters) {
+}
+
+WindowMaximizeCommand::~WindowMaximizeCommand() {
+}
+
+bool WindowMaximizeCommand::DoesPost() {
+ return true;
+}
+
+void WindowMaximizeCommand::ExecutePost(Response* const response) {
+ // Path segment: "/session/$sessionId/window/$windowHandle/maximize"
+ WebViewId window_id;
+ WebViewId current_id = session_->current_target().view_id;
+ if (!GetWindowId(GetPathVariable(4), current_id, &window_id, response))
+ return;
+
+ Error* error = session_->MaximizeWindow(window_id);
+ if (error) {
+ response->SetError(error);
+ return;
+ }
+}
+
} // namespace webdriver

Powered by Google App Engine
This is Rietveld 408576698