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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 if (status.IsError()) { | 493 if (status.IsError()) { |
494 device->TearDown(); | 494 device->TearDown(); |
495 return status; | 495 return status; |
496 } | 496 } |
497 | 497 |
498 std::string package = devtools_http_client->browser_info()->android_package; | 498 std::string package = devtools_http_client->browser_info()->android_package; |
499 if (package != capabilities.android_package) { | 499 if (package != capabilities.android_package) { |
500 device->TearDown(); | 500 device->TearDown(); |
501 return Status( | 501 return Status( |
502 kSessionNotCreatedException, | 502 kSessionNotCreatedException, |
503 base::StringPrintf("please close %s and try again", package.c_str())); | 503 base::StringPrintf("please close '%s' and try again", package.c_str())); |
504 } | 504 } |
505 | 505 |
506 scoped_ptr<DevToolsClient> devtools_websocket_client; | 506 scoped_ptr<DevToolsClient> devtools_websocket_client; |
507 status = CreateBrowserwideDevToolsClientAndConnect( | 507 status = CreateBrowserwideDevToolsClientAndConnect( |
508 NetAddress(port), capabilities.perf_logging_prefs, socket_factory, | 508 NetAddress(port), capabilities.perf_logging_prefs, socket_factory, |
509 *devtools_event_listeners, &devtools_websocket_client); | 509 *devtools_event_listeners, &devtools_websocket_client); |
510 if (status.IsError()) { | 510 if (status.IsError()) { |
511 LOG(WARNING) << "Browser-wide DevTools client failed to connect: " | 511 LOG(WARNING) << "Browser-wide DevTools client failed to connect: " |
512 << status.message(); | 512 << status.message(); |
513 } | 513 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 // Write empty "First Run" file, otherwise Chrome will wipe the default | 851 // Write empty "First Run" file, otherwise Chrome will wipe the default |
852 // profile that was written. | 852 // profile that was written. |
853 if (base::WriteFile( | 853 if (base::WriteFile( |
854 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 854 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
855 return Status(kUnknownError, "failed to write first run file"); | 855 return Status(kUnknownError, "failed to write first run file"); |
856 } | 856 } |
857 return Status(kOk); | 857 return Status(kOk); |
858 } | 858 } |
859 | 859 |
860 } // namespace internal | 860 } // namespace internal |
OLD | NEW |