Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/test/multiprocess_test.h" | 5 #include "base/test/multiprocess_test.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 | 29 |
| 30 CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname, | 30 CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname, |
| 31 bool debug_on_start) { | 31 bool debug_on_start) { |
| 32 CommandLine cl(*CommandLine::ForCurrentProcess()); | 32 CommandLine cl(*CommandLine::ForCurrentProcess()); |
| 33 cl.AppendSwitchASCII(switches::kTestChildProcess, procname); | 33 cl.AppendSwitchASCII(switches::kTestChildProcess, procname); |
| 34 if (debug_on_start) | 34 if (debug_on_start) |
| 35 cl.AppendSwitch(switches::kDebugOnStart); | 35 cl.AppendSwitch(switches::kDebugOnStart); |
| 36 return cl; | 36 return cl; |
| 37 } | 37 } |
| 38 | 38 |
| 39 #if !defined(OS_ANDROID) | |
|
Yaron
2012/05/23 16:42:01
I forget... isn't this style frowned upon (removin
| |
| 39 ProcessHandle MultiProcessTest::SpawnChildImpl( | 40 ProcessHandle MultiProcessTest::SpawnChildImpl( |
| 40 const std::string& procname, | 41 const std::string& procname, |
| 41 const FileHandleMappingVector& fds_to_map, | 42 const FileHandleMappingVector& fds_to_map, |
| 42 bool debug_on_start) { | 43 bool debug_on_start) { |
| 43 ProcessHandle handle = kNullProcessHandle; | 44 ProcessHandle handle = kNullProcessHandle; |
| 44 base::LaunchOptions options; | 45 base::LaunchOptions options; |
| 45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 46 options.start_hidden = true; | 47 options.start_hidden = true; |
| 47 #else | 48 #else |
| 48 options.fds_to_remap = &fds_to_map; | 49 options.fds_to_remap = &fds_to_map; |
| 49 #endif | 50 #endif |
| 50 base::LaunchProcess(MakeCmdLine(procname, debug_on_start), options, &handle); | 51 base::LaunchProcess(MakeCmdLine(procname, debug_on_start), options, &handle); |
| 51 return handle; | 52 return handle; |
| 52 } | 53 } |
| 54 #endif // !defined(OS_ANDROID) | |
| 53 | 55 |
| 54 } // namespace base | 56 } // namespace base |
| OLD | NEW |