| OLD | NEW |
| 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 void Automation::SetViewBounds(const WebViewId& view_id, | 878 void Automation::SetViewBounds(const WebViewId& view_id, |
| 879 const Rect& bounds, | 879 const Rect& bounds, |
| 880 Error** error) { | 880 Error** error) { |
| 881 automation::Error auto_error; | 881 automation::Error auto_error; |
| 882 if (!SendSetViewBoundsJSONRequest( | 882 if (!SendSetViewBoundsJSONRequest( |
| 883 automation(), view_id, bounds.x(), bounds.y(), | 883 automation(), view_id, bounds.x(), bounds.y(), |
| 884 bounds.width(), bounds.height(), &auto_error)) | 884 bounds.width(), bounds.height(), &auto_error)) |
| 885 *error = Error::FromAutomationError(auto_error); | 885 *error = Error::FromAutomationError(auto_error); |
| 886 } | 886 } |
| 887 | 887 |
| 888 void Automation::MaximizeView(const WebViewId& view_id, Error** error) { |
| 889 *error = CheckMaximizeSupported(); |
| 890 if (*error) |
| 891 return; |
| 892 |
| 893 automation::Error auto_error; |
| 894 if (!SendMaximizeJSONRequest( |
| 895 automation(), view_id, &auto_error)) |
| 896 *error = Error::FromAutomationError(auto_error); |
| 897 } |
| 898 |
| 888 void Automation::GetAppModalDialogMessage(std::string* message, Error** error) { | 899 void Automation::GetAppModalDialogMessage(std::string* message, Error** error) { |
| 889 *error = CheckAlertsSupported(); | 900 *error = CheckAlertsSupported(); |
| 890 if (*error) | 901 if (*error) |
| 891 return; | 902 return; |
| 892 | 903 |
| 893 automation::Error auto_error; | 904 automation::Error auto_error; |
| 894 if (!SendGetAppModalDialogMessageJSONRequest( | 905 if (!SendGetAppModalDialogMessageJSONRequest( |
| 895 automation(), message, &auto_error)) { | 906 automation(), message, &auto_error)) { |
| 896 *error = Error::FromAutomationError(auto_error); | 907 *error = Error::FromAutomationError(auto_error); |
| 897 } | 908 } |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 return CheckVersion(947, message); | 1167 return CheckVersion(947, message); |
| 1157 } | 1168 } |
| 1158 | 1169 |
| 1159 Error* Automation::CheckGeolocationSupported() { | 1170 Error* Automation::CheckGeolocationSupported() { |
| 1160 const char* message = | 1171 const char* message = |
| 1161 "Geolocation automation interface is not supported for this version of " | 1172 "Geolocation automation interface is not supported for this version of " |
| 1162 "Chrome."; | 1173 "Chrome."; |
| 1163 return CheckVersion(1119, message); | 1174 return CheckVersion(1119, message); |
| 1164 } | 1175 } |
| 1165 | 1176 |
| 1177 Error* Automation::CheckMaximizeSupported() { |
| 1178 const char* message = |
| 1179 "Maximize automation interface is not supported for this version of " |
| 1180 "Chrome."; |
| 1181 return CheckVersion(1160, message); |
| 1182 } |
| 1183 |
| 1166 } // namespace webdriver | 1184 } // namespace webdriver |
| OLD | NEW |