| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // Redirect stderr to /dev/null, so that Chrome log spew doesn't confuse | 364 // Redirect stderr to /dev/null, so that Chrome log spew doesn't confuse |
| 365 // users. | 365 // users. |
| 366 devnull.reset(HANDLE_EINTR(open("/dev/null", O_WRONLY))); | 366 devnull.reset(HANDLE_EINTR(open("/dev/null", O_WRONLY))); |
| 367 if (!devnull.is_valid()) | 367 if (!devnull.is_valid()) |
| 368 return Status(kUnknownError, "couldn't open /dev/null"); | 368 return Status(kUnknownError, "couldn't open /dev/null"); |
| 369 no_stderr.push_back(std::make_pair(devnull.get(), STDERR_FILENO)); | 369 no_stderr.push_back(std::make_pair(devnull.get(), STDERR_FILENO)); |
| 370 options.fds_to_remap = &no_stderr; | 370 options.fds_to_remap = &no_stderr; |
| 371 } | 371 } |
| 372 #elif defined(OS_WIN) | 372 #elif defined(OS_WIN) |
| 373 if (!SwitchToUSKeyboardLayout()) | 373 if (!SwitchToUSKeyboardLayout()) |
| 374 VLOG(0) << "Can not set to US keyboard layout - Some keycodes may be" | 374 VLOG(0) << "Cannot switch to US keyboard layout - some keys may be " |
| 375 "interpreted incorrectly"; | 375 "interpreted incorrectly"; |
| 376 #endif | 376 #endif |
| 377 | 377 |
| 378 #if defined(OS_WIN) | 378 #if defined(OS_WIN) |
| 379 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); | 379 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); |
| 380 #else | 380 #else |
| 381 std::string command_string = command.GetCommandLineString(); | 381 std::string command_string = command.GetCommandLineString(); |
| 382 #endif | 382 #endif |
| 383 VLOG(0) << "Launching chrome: " << command_string; | 383 VLOG(0) << "Launching chrome: " << command_string; |
| 384 base::Process process = base::LaunchProcess(command, options); | 384 base::Process process = base::LaunchProcess(command, options); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // Write empty "First Run" file, otherwise Chrome will wipe the default | 875 // Write empty "First Run" file, otherwise Chrome will wipe the default |
| 876 // profile that was written. | 876 // profile that was written. |
| 877 if (base::WriteFile( | 877 if (base::WriteFile( |
| 878 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 878 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
| 879 return Status(kUnknownError, "failed to write first run file"); | 879 return Status(kUnknownError, "failed to write first run file"); |
| 880 } | 880 } |
| 881 return Status(kOk); | 881 return Status(kOk); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace internal | 884 } // namespace internal |
| OLD | NEW |