| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const Capabilities& capabilities, | 69 const Capabilities& capabilities, |
| 70 CommandLine* prepared_command, | 70 CommandLine* prepared_command, |
| 71 base::ScopedTempDir* user_data_dir, | 71 base::ScopedTempDir* user_data_dir, |
| 72 base::ScopedTempDir* extension_dir) { | 72 base::ScopedTempDir* extension_dir) { |
| 73 CommandLine command = capabilities.command; | 73 CommandLine command = capabilities.command; |
| 74 base::FilePath program = command.GetProgram(); | 74 base::FilePath program = command.GetProgram(); |
| 75 if (program.empty()) { | 75 if (program.empty()) { |
| 76 if (!FindChrome(&program)) | 76 if (!FindChrome(&program)) |
| 77 return Status(kUnknownError, "cannot find Chrome binary"); | 77 return Status(kUnknownError, "cannot find Chrome binary"); |
| 78 command.SetProgram(program); | 78 command.SetProgram(program); |
| 79 } else if (!file_util::PathExists(program)) { | 79 } else if (!base::PathExists(program)) { |
| 80 return Status(kUnknownError, | 80 return Status(kUnknownError, |
| 81 base::StringPrintf("no chrome binary at %" PRFilePath, | 81 base::StringPrintf("no chrome binary at %" PRFilePath, |
| 82 program.value().c_str())); | 82 program.value().c_str())); |
| 83 } | 83 } |
| 84 | 84 |
| 85 command.AppendSwitchASCII("remote-debugging-port", base::IntToString(port)); | 85 command.AppendSwitchASCII("remote-debugging-port", base::IntToString(port)); |
| 86 command.AppendSwitch("no-first-run"); | 86 command.AppendSwitch("no-first-run"); |
| 87 command.AppendSwitch("enable-logging"); | 87 command.AppendSwitch("enable-logging"); |
| 88 command.AppendSwitchASCII("logging-level", "1"); | 88 command.AppendSwitchASCII("logging-level", "1"); |
| 89 command.AppendArg("data:text/html;charset=utf-8,"); | 89 command.AppendArg("data:text/html;charset=utf-8,"); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // Write empty "First Run" file, otherwise Chrome will wipe the default | 468 // Write empty "First Run" file, otherwise Chrome will wipe the default |
| 469 // profile that was written. | 469 // profile that was written. |
| 470 if (file_util::WriteFile( | 470 if (file_util::WriteFile( |
| 471 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { | 471 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { |
| 472 return Status(kUnknownError, "failed to write first run file"); | 472 return Status(kUnknownError, "failed to write first run file"); |
| 473 } | 473 } |
| 474 return Status(kOk); | 474 return Status(kOk); |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace internal | 477 } // namespace internal |
| OLD | NEW |