| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 | 707 |
| 708 void Automation::SendWebMouseEvent(const WebViewId& view_id, | 708 void Automation::SendWebMouseEvent(const WebViewId& view_id, |
| 709 const WebMouseEvent& event, | 709 const WebMouseEvent& event, |
| 710 Error** error) { | 710 Error** error) { |
| 711 WebViewLocator view_locator; | 711 WebViewLocator view_locator; |
| 712 *error = ConvertViewIdToLocator(view_id, &view_locator); | 712 *error = ConvertViewIdToLocator(view_id, &view_locator); |
| 713 if (*error) | 713 if (*error) |
| 714 return; | 714 return; |
| 715 | 715 |
| 716 automation::Error auto_error; | 716 automation::Error auto_error; |
| 717 if (!SendWebMouseEventJSONRequest( | 717 if (!SendWebMouseEventJSONRequestDeprecated( |
| 718 automation(), view_locator, event, &auto_error)) { | 718 automation(), view_locator, event, &auto_error)) { |
| 719 *error = Error::FromAutomationError(auto_error); | 719 *error = Error::FromAutomationError(auto_error); |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 | 722 |
| 723 void Automation::CaptureEntirePageAsPNG(const WebViewId& view_id, | 723 void Automation::CaptureEntirePageAsPNG(const WebViewId& view_id, |
| 724 const base::FilePath& path, | 724 const base::FilePath& path, |
| 725 Error** error) { | 725 Error** error) { |
| 726 WebViewLocator view_locator; | 726 WebViewLocator view_locator; |
| 727 *error = ConvertViewIdToLocator(view_id, &view_locator); | 727 *error = ConvertViewIdToLocator(view_id, &view_locator); |
| 728 if (*error) | 728 if (*error) |
| 729 return; | 729 return; |
| 730 | 730 |
| 731 automation::Error auto_error; | 731 automation::Error auto_error; |
| 732 if (!SendCaptureEntirePageJSONRequest( | 732 if (!SendCaptureEntirePageJSONRequestDeprecated( |
| 733 automation(), view_locator, path, &auto_error)) { | 733 automation(), view_locator, path, &auto_error)) { |
| 734 *error = Error::FromAutomationError(auto_error); | 734 *error = Error::FromAutomationError(auto_error); |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 | 737 |
| 738 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 738 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
| 739 void Automation::HeapProfilerDump(const WebViewId& view_id, | 739 void Automation::HeapProfilerDump(const WebViewId& view_id, |
| 740 const std::string& reason, | 740 const std::string& reason, |
| 741 Error** error) { | 741 Error** error) { |
| 742 WebViewLocator view_locator; | 742 WebViewLocator view_locator; |
| 743 *error = ConvertViewIdToLocator(view_id, &view_locator); | 743 *error = ConvertViewIdToLocator(view_id, &view_locator); |
| 744 if (*error) | 744 if (*error) |
| 745 return; | 745 return; |
| 746 | 746 |
| 747 automation::Error auto_error; | 747 automation::Error auto_error; |
| 748 if (!SendHeapProfilerDumpJSONRequest( | 748 if (!SendHeapProfilerDumpJSONRequestDeprecated( |
| 749 automation(), view_locator, reason, &auto_error)) { | 749 automation(), view_locator, reason, &auto_error)) { |
| 750 *error = Error::FromAutomationError(auto_error); | 750 *error = Error::FromAutomationError(auto_error); |
| 751 } | 751 } |
| 752 } | 752 } |
| 753 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 753 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
| 754 | 754 |
| 755 void Automation::NavigateToURL(const WebViewId& view_id, | 755 void Automation::NavigateToURL(const WebViewId& view_id, |
| 756 const std::string& url, | 756 const std::string& url, |
| 757 Error** error) { | 757 Error** error) { |
| 758 WebViewLocator view_locator; | 758 WebViewLocator view_locator; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 } | 969 } |
| 970 | 970 |
| 971 void Automation::GetChromeDriverAutomationVersion(int* version, Error** error) { | 971 void Automation::GetChromeDriverAutomationVersion(int* version, Error** error) { |
| 972 automation::Error auto_error; | 972 automation::Error auto_error; |
| 973 if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error)) | 973 if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error)) |
| 974 *error = Error::FromAutomationError(auto_error); | 974 *error = Error::FromAutomationError(auto_error); |
| 975 } | 975 } |
| 976 | 976 |
| 977 void Automation::WaitForAllViewsToStopLoading(Error** error) { | 977 void Automation::WaitForAllViewsToStopLoading(Error** error) { |
| 978 automation::Error auto_error; | 978 automation::Error auto_error; |
| 979 if (!SendWaitForAllViewsToStopLoadingJSONRequest(automation(), &auto_error)) | 979 if (!SendWaitForAllViewsToStopLoadingJSONRequestDeprecated( |
| 980 automation(), &auto_error)) |
| 980 *error = Error::FromAutomationError(auto_error); | 981 *error = Error::FromAutomationError(auto_error); |
| 981 } | 982 } |
| 982 | 983 |
| 983 void Automation::InstallExtension( | 984 void Automation::InstallExtension( |
| 984 const base::FilePath& path, std::string* extension_id, Error** error) { | 985 const base::FilePath& path, std::string* extension_id, Error** error) { |
| 985 *error = CheckNewExtensionInterfaceSupported(); | 986 *error = CheckNewExtensionInterfaceSupported(); |
| 986 if (*error) | 987 if (*error) |
| 987 return; | 988 return; |
| 988 | 989 |
| 989 automation::Error auto_error; | 990 automation::Error auto_error; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 } | 1207 } |
| 1207 | 1208 |
| 1208 Error* Automation::CheckMaximizeSupported() { | 1209 Error* Automation::CheckMaximizeSupported() { |
| 1209 const char* message = | 1210 const char* message = |
| 1210 "Maximize automation interface is not supported for this version of " | 1211 "Maximize automation interface is not supported for this version of " |
| 1211 "Chrome."; | 1212 "Chrome."; |
| 1212 return CheckVersion(1160, message); | 1213 return CheckVersion(1160, message); |
| 1213 } | 1214 } |
| 1214 | 1215 |
| 1215 } // namespace webdriver | 1216 } // namespace webdriver |
| OLD | NEW |