OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromedriver/chrome_launcher.h" | 5 #include "chrome/test/chromedriver/chrome_launcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 std::unique_ptr<std::set<WebViewInfo::Type>> window_types; | 190 std::unique_ptr<std::set<WebViewInfo::Type>> window_types; |
191 if (capabilities && !capabilities->window_types.empty()) { | 191 if (capabilities && !capabilities->window_types.empty()) { |
192 window_types.reset( | 192 window_types.reset( |
193 new std::set<WebViewInfo::Type>(capabilities->window_types)); | 193 new std::set<WebViewInfo::Type>(capabilities->window_types)); |
194 } else { | 194 } else { |
195 window_types.reset(new std::set<WebViewInfo::Type>()); | 195 window_types.reset(new std::set<WebViewInfo::Type>()); |
196 } | 196 } |
197 | 197 |
198 std::unique_ptr<DevToolsHttpClient> client(new DevToolsHttpClient( | 198 std::unique_ptr<DevToolsHttpClient> client(new DevToolsHttpClient( |
199 address, context_getter, socket_factory, std::move(device_metrics), | 199 address, context_getter, socket_factory, std::move(device_metrics), |
200 std::move(window_types))); | 200 std::move(window_types), capabilities->page_loading)); |
201 base::TimeTicks deadline = | 201 base::TimeTicks deadline = |
202 base::TimeTicks::Now() + base::TimeDelta::FromSeconds(60); | 202 base::TimeTicks::Now() + base::TimeDelta::FromSeconds(60); |
203 Status status = client->Init(deadline - base::TimeTicks::Now()); | 203 Status status = client->Init(deadline - base::TimeTicks::Now()); |
204 if (status.IsError()) | 204 if (status.IsError()) |
205 return status; | 205 return status; |
206 | 206 |
207 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 207 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
208 if (cmd_line->HasSwitch("disable-build-check")) { | 208 if (cmd_line->HasSwitch("disable-build-check")) { |
209 LOG(WARNING) << "You are using an unsupported command-line switch: " | 209 LOG(WARNING) << "You are using an unsupported command-line switch: " |
210 "--disable-build-check. Please don't report bugs that " | 210 "--disable-build-check. Please don't report bugs that " |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 Status LaunchRemoteChromeSession( | 266 Status LaunchRemoteChromeSession( |
267 URLRequestContextGetter* context_getter, | 267 URLRequestContextGetter* context_getter, |
268 const SyncWebSocketFactory& socket_factory, | 268 const SyncWebSocketFactory& socket_factory, |
269 const Capabilities& capabilities, | 269 const Capabilities& capabilities, |
270 ScopedVector<DevToolsEventListener>* devtools_event_listeners, | 270 ScopedVector<DevToolsEventListener>* devtools_event_listeners, |
271 std::unique_ptr<Chrome>* chrome) { | 271 std::unique_ptr<Chrome>* chrome) { |
272 Status status(kOk); | 272 Status status(kOk); |
273 std::unique_ptr<DevToolsHttpClient> devtools_http_client; | 273 std::unique_ptr<DevToolsHttpClient> devtools_http_client; |
274 status = WaitForDevToolsAndCheckVersion( | 274 status = WaitForDevToolsAndCheckVersion( |
275 capabilities.debugger_address, context_getter, socket_factory, | 275 capabilities.debugger_address, context_getter, socket_factory, |
276 NULL, &devtools_http_client); | 276 &capabilities, &devtools_http_client); |
277 if (status.IsError()) { | 277 if (status.IsError()) { |
278 return Status(kUnknownError, "cannot connect to chrome at " + | 278 return Status(kUnknownError, "cannot connect to chrome at " + |
279 capabilities.debugger_address.ToString(), | 279 capabilities.debugger_address.ToString(), |
280 status); | 280 status); |
281 } | 281 } |
282 | 282 |
283 std::unique_ptr<DevToolsClient> devtools_websocket_client; | 283 std::unique_ptr<DevToolsClient> devtools_websocket_client; |
284 status = CreateBrowserwideDevToolsClientAndConnect( | 284 status = CreateBrowserwideDevToolsClientAndConnect( |
285 capabilities.debugger_address, capabilities.perf_logging_prefs, | 285 capabilities.debugger_address, capabilities.perf_logging_prefs, |
286 socket_factory, *devtools_event_listeners, &devtools_websocket_client); | 286 socket_factory, *devtools_event_listeners, &devtools_websocket_client); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 // Write empty "First Run" file, otherwise Chrome will wipe the default | 861 // Write empty "First Run" file, otherwise Chrome will wipe the default |
862 // profile that was written. | 862 // profile that was written. |
863 if (base::WriteFile( | 863 if (base::WriteFile( |
864 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 864 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
865 return Status(kUnknownError, "failed to write first run file"); | 865 return Status(kUnknownError, "failed to write first run file"); |
866 } | 866 } |
867 return Status(kOk); | 867 return Status(kOk); |
868 } | 868 } |
869 | 869 |
870 } // namespace internal | 870 } // namespace internal |
OLD | NEW |