| 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 12 matching lines...) Expand all Loading... |
| 23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 24 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
| 25 #include "base/values.h" | 25 #include "base/values.h" |
| 26 #include "chrome/common/automation_constants.h" | 26 #include "chrome/common/automation_constants.h" |
| 27 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "chrome/test/automation/automation_json_requests.h" | 30 #include "chrome/test/automation/automation_json_requests.h" |
| 31 #include "chrome/test/automation/automation_proxy.h" | 31 #include "chrome/test/automation/automation_proxy.h" |
| 32 #include "chrome/test/automation/browser_proxy.h" | 32 #include "chrome/test/automation/browser_proxy.h" |
| 33 #include "chrome/test/automation/extension_proxy.h" | |
| 34 #include "chrome/test/automation/proxy_launcher.h" | 33 #include "chrome/test/automation/proxy_launcher.h" |
| 35 #include "chrome/test/automation/tab_proxy.h" | 34 #include "chrome/test/automation/tab_proxy.h" |
| 36 #include "chrome/test/base/chrome_process_util.h" | 35 #include "chrome/test/base/chrome_process_util.h" |
| 37 #include "chrome/test/webdriver/frame_path.h" | 36 #include "chrome/test/webdriver/frame_path.h" |
| 38 #include "chrome/test/webdriver/webdriver_basic_types.h" | 37 #include "chrome/test/webdriver/webdriver_basic_types.h" |
| 39 #include "chrome/test/webdriver/webdriver_error.h" | 38 #include "chrome/test/webdriver/webdriver_error.h" |
| 40 #include "chrome/test/webdriver/webdriver_util.h" | 39 #include "chrome/test/webdriver/webdriver_util.h" |
| 41 | 40 |
| 42 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 43 #include "base/win/registry.h" | 42 #include "base/win/registry.h" |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error)) | 771 if (!SendGetChromeDriverAutomationVersion(automation(), version, &auto_error)) |
| 773 *error = Error::FromAutomationError(auto_error); | 772 *error = Error::FromAutomationError(auto_error); |
| 774 } | 773 } |
| 775 | 774 |
| 776 void Automation::WaitForAllViewsToStopLoading(Error** error) { | 775 void Automation::WaitForAllViewsToStopLoading(Error** error) { |
| 777 automation::Error auto_error; | 776 automation::Error auto_error; |
| 778 if (!SendWaitForAllViewsToStopLoadingJSONRequest(automation(), &auto_error)) | 777 if (!SendWaitForAllViewsToStopLoadingJSONRequest(automation(), &auto_error)) |
| 779 *error = Error::FromAutomationError(auto_error); | 778 *error = Error::FromAutomationError(auto_error); |
| 780 } | 779 } |
| 781 | 780 |
| 782 void Automation::InstallExtensionDeprecated( | |
| 783 const FilePath& path, Error** error) { | |
| 784 if (!launcher_->automation()->InstallExtension(path, false).get()) | |
| 785 *error = new Error(kUnknownError, "Failed to install extension"); | |
| 786 } | |
| 787 | |
| 788 void Automation::InstallExtension( | 781 void Automation::InstallExtension( |
| 789 const FilePath& path, std::string* extension_id, Error** error) { | 782 const FilePath& path, std::string* extension_id, Error** error) { |
| 790 *error = CheckNewExtensionInterfaceSupported(); | 783 *error = CheckNewExtensionInterfaceSupported(); |
| 791 if (*error) | 784 if (*error) |
| 792 return; | 785 return; |
| 793 | 786 |
| 794 automation::Error auto_error; | 787 automation::Error auto_error; |
| 795 if (!SendInstallExtensionJSONRequest( | 788 if (!SendInstallExtensionJSONRequest( |
| 796 automation(), path, false /* with_ui */, extension_id, | 789 automation(), path, false /* with_ui */, extension_id, |
| 797 &auto_error)) | 790 &auto_error)) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 return CheckVersion(750, message); | 961 return CheckVersion(750, message); |
| 969 } | 962 } |
| 970 | 963 |
| 971 Error* Automation::CheckNewExtensionInterfaceSupported() { | 964 Error* Automation::CheckNewExtensionInterfaceSupported() { |
| 972 const char* message = | 965 const char* message = |
| 973 "Extension interface is not supported for this version of Chrome"; | 966 "Extension interface is not supported for this version of Chrome"; |
| 974 return CheckVersion(947, message); | 967 return CheckVersion(947, message); |
| 975 } | 968 } |
| 976 | 969 |
| 977 } // namespace webdriver | 970 } // namespace webdriver |
| OLD | NEW |