OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation.h" | 5 #include "chrome/test/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 |
11 #include "base/base_paths.h" | 11 #include "base/base_paths.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/environment.h" | 13 #include "base/environment.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
20 #include "base/string_split.h" | 20 #include "base/string_split.h" |
21 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
| 22 #include "base/synchronization/waitable_event.h" |
22 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
23 #include "base/values.h" | 24 #include "base/values.h" |
24 #include "chrome/common/automation_constants.h" | 25 #include "chrome/common/automation_constants.h" |
25 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
28 #include "chrome/test/automation/automation_json_requests.h" | 29 #include "chrome/test/automation/automation_json_requests.h" |
29 #include "chrome/test/automation/automation_proxy.h" | 30 #include "chrome/test/automation/automation_proxy.h" |
30 #include "chrome/test/automation/proxy_launcher.h" | 31 #include "chrome/test/automation/proxy_launcher.h" |
31 #include "chrome/test/webdriver/frame_path.h" | 32 #include "chrome/test/webdriver/frame_path.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 browser_exe.value().c_str()); | 172 browser_exe.value().c_str()); |
172 VLOG(1) << chrome_details; | 173 VLOG(1) << chrome_details; |
173 | 174 |
174 if (!launcher_->LaunchBrowserAndServer(launch_props, true)) { | 175 if (!launcher_->LaunchBrowserAndServer(launch_props, true)) { |
175 *error = new Error( | 176 *error = new Error( |
176 kUnknownError, | 177 kUnknownError, |
177 "Unable to either launch or connect to Chrome. Please check that " | 178 "Unable to either launch or connect to Chrome. Please check that " |
178 "ChromeDriver is up-to-date. " + chrome_details); | 179 "ChromeDriver is up-to-date. " + chrome_details); |
179 return; | 180 return; |
180 } | 181 } |
| 182 |
| 183 launcher_->automation()->set_action_timeout_ms(base::kNoTimeout); |
181 VLOG(1) << "Chrome launched successfully. Version: " | 184 VLOG(1) << "Chrome launched successfully. Version: " |
182 << automation()->server_version(); | 185 << automation()->server_version(); |
183 | 186 |
184 bool has_automation_version = false; | 187 bool has_automation_version = false; |
185 *error = CompareVersion(730, 0, &has_automation_version); | 188 *error = CompareVersion(730, 0, &has_automation_version); |
186 if (*error) | 189 if (*error) |
187 return; | 190 return; |
188 | 191 |
189 chrome_details += ", version (" + automation()->server_version() + ")"; | 192 chrome_details += ", version (" + automation()->server_version() + ")"; |
190 if (has_automation_version) { | 193 if (has_automation_version) { |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 768, 0, "Alerts are not supported for this version of Chrome"); | 656 768, 0, "Alerts are not supported for this version of Chrome"); |
654 } | 657 } |
655 | 658 |
656 Error* Automation::CheckAdvancedInteractionsSupported() { | 659 Error* Automation::CheckAdvancedInteractionsSupported() { |
657 const char* message = | 660 const char* message = |
658 "Advanced user interactions are not supported for this version of Chrome"; | 661 "Advanced user interactions are not supported for this version of Chrome"; |
659 return CheckVersion(750, 0, message); | 662 return CheckVersion(750, 0, message); |
660 } | 663 } |
661 | 664 |
662 } // namespace webdriver | 665 } // namespace webdriver |
OLD | NEW |