| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 &command, | 220 &command, |
| 221 &user_data_dir, | 221 &user_data_dir, |
| 222 &extension_dir, | 222 &extension_dir, |
| 223 &extension_bg_pages); | 223 &extension_bg_pages); |
| 224 if (status.IsError()) | 224 if (status.IsError()) |
| 225 return status; | 225 return status; |
| 226 | 226 |
| 227 base::LaunchOptions options; | 227 base::LaunchOptions options; |
| 228 | 228 |
| 229 #if !defined(OS_WIN) | 229 #if !defined(OS_WIN) |
| 230 base::EnvironmentVector environ; | 230 if (!capabilities.log_path.empty()) |
| 231 if (!capabilities.log_path.empty()) { | 231 options.environ["CHROME_LOG_FILE"] = capabilities.log_path; |
| 232 environ.push_back( | |
| 233 base::EnvironmentVector::value_type("CHROME_LOG_FILE", | |
| 234 capabilities.log_path)); | |
| 235 options.environ = &environ; | |
| 236 } | |
| 237 if (capabilities.detach) | 232 if (capabilities.detach) |
| 238 options.new_process_group = true; | 233 options.new_process_group = true; |
| 239 #endif | 234 #endif |
| 240 | 235 |
| 241 #if defined(OS_WIN) | 236 #if defined(OS_WIN) |
| 242 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); | 237 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); |
| 243 #else | 238 #else |
| 244 std::string command_string = command.GetCommandLineString(); | 239 std::string command_string = command.GetCommandLineString(); |
| 245 #endif | 240 #endif |
| 246 log->AddEntry(Log::kLog, "Launching chrome: " + command_string); | 241 log->AddEntry(Log::kLog, "Launching chrome: " + command_string); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 // Write empty "First Run" file, otherwise Chrome will wipe the default | 594 // Write empty "First Run" file, otherwise Chrome will wipe the default |
| 600 // profile that was written. | 595 // profile that was written. |
| 601 if (file_util::WriteFile( | 596 if (file_util::WriteFile( |
| 602 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { | 597 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { |
| 603 return Status(kUnknownError, "failed to write first run file"); | 598 return Status(kUnknownError, "failed to write first run file"); |
| 604 } | 599 } |
| 605 return Status(kOk); | 600 return Status(kOk); |
| 606 } | 601 } |
| 607 | 602 |
| 608 } // namespace internal | 603 } // namespace internal |
| OLD | NEW |