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

Side by Side Diff: chrome/test/webdriver/webdriver_automation.cc

Issue 10388251: Support maximize window command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit test in chromedriver_tests.py; nicer error reporting - a method to check whether the current v… 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/webdriver/webdriver_automation.h" 5 #include "chrome/test/webdriver/webdriver_automation.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 void Automation::SetViewBounds(const WebViewId& view_id, 735 void Automation::SetViewBounds(const WebViewId& view_id,
736 const Rect& bounds, 736 const Rect& bounds,
737 Error** error) { 737 Error** error) {
738 automation::Error auto_error; 738 automation::Error auto_error;
739 if (!SendSetViewBoundsJSONRequest( 739 if (!SendSetViewBoundsJSONRequest(
740 automation(), view_id, bounds.x(), bounds.y(), 740 automation(), view_id, bounds.x(), bounds.y(),
741 bounds.width(), bounds.height(), &auto_error)) 741 bounds.width(), bounds.height(), &auto_error))
742 *error = Error::FromAutomationError(auto_error); 742 *error = Error::FromAutomationError(auto_error);
743 } 743 }
744 744
745 void Automation::MaximizeView(const WebViewId& view_id, Error** error) {
746 *error = CheckMaximizeSupported();
747 if (*error)
748 return;
749
750 automation::Error auto_error;
751 if (!SendMaximizeJSONRequest(
752 automation(), view_id, &auto_error))
753 *error = Error::FromAutomationError(auto_error);
754 }
755
745 void Automation::GetAppModalDialogMessage(std::string* message, Error** error) { 756 void Automation::GetAppModalDialogMessage(std::string* message, Error** error) {
746 *error = CheckAlertsSupported(); 757 *error = CheckAlertsSupported();
747 if (*error) 758 if (*error)
748 return; 759 return;
749 760
750 automation::Error auto_error; 761 automation::Error auto_error;
751 if (!SendGetAppModalDialogMessageJSONRequest( 762 if (!SendGetAppModalDialogMessageJSONRequest(
752 automation(), message, &auto_error)) { 763 automation(), message, &auto_error)) {
753 *error = Error::FromAutomationError(auto_error); 764 *error = Error::FromAutomationError(auto_error);
754 } 765 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 return CheckVersion(947, message); 1024 return CheckVersion(947, message);
1014 } 1025 }
1015 1026
1016 Error* Automation::CheckGeolocationSupported() { 1027 Error* Automation::CheckGeolocationSupported() {
1017 const char* message = 1028 const char* message =
1018 "Geolocation automation interface is not supported for this version of " 1029 "Geolocation automation interface is not supported for this version of "
1019 "Chrome."; 1030 "Chrome.";
1020 return CheckVersion(1119, message); 1031 return CheckVersion(1119, message);
1021 } 1032 }
1022 1033
1034 Error* Automation::CheckMaximizeSupported() {
1035 const char* message =
1036 "Maximize automation interface is not supported for this version of "
1037 "Chrome.";
1038 return CheckVersion(1148, message);
1039 }
1040
1023 } // namespace webdriver 1041 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698