OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef BASE_MULTIPROCESS_TEST_H_ | 5 #ifndef BASE_MULTIPROCESS_TEST_H__ |
6 #define BASE_MULTIPROCESS_TEST_H_ | 6 #define BASE_MULTIPROCESS_TEST_H__ |
7 | 7 |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "testing/multiprocess_func_list.h" | 13 #include "testing/multiprocess_func_list.h" |
14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
15 | 15 |
16 #if defined(OS_POSIX) | 16 #if defined(OS_POSIX) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return handle; | 99 return handle; |
100 } | 100 } |
101 #elif defined(OS_POSIX) | 101 #elif defined(OS_POSIX) |
102 // TODO(port): with the CommandLine refactoring, this code is very similar | 102 // TODO(port): with the CommandLine refactoring, this code is very similar |
103 // to the Windows code. Investigate whether this can be made shorter. | 103 // to the Windows code. Investigate whether this can be made shorter. |
104 base::ProcessHandle SpawnChildImpl( | 104 base::ProcessHandle SpawnChildImpl( |
105 const std::wstring& procname, | 105 const std::wstring& procname, |
106 const base::file_handle_mapping_vector& fds_to_map, | 106 const base::file_handle_mapping_vector& fds_to_map, |
107 bool debug_on_start) { | 107 bool debug_on_start) { |
108 CommandLine cl(*CommandLine::ForCurrentProcess()); | 108 CommandLine cl(*CommandLine::ForCurrentProcess()); |
109 base::ProcessHandle handle = 0; | 109 base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL); |
110 cl.AppendSwitchWithValue(kRunClientProcess, procname); | 110 cl.AppendSwitchWithValue(kRunClientProcess, procname); |
111 | 111 |
112 if (debug_on_start) | 112 if (debug_on_start) |
113 cl.AppendSwitch(switches::kDebugOnStart); | 113 cl.AppendSwitch(switches::kDebugOnStart); |
114 | 114 |
115 base::LaunchApp(cl.argv(), fds_to_map, false, &handle); | 115 base::LaunchApp(cl.argv(), fds_to_map, false, &handle); |
116 return handle; | 116 return handle; |
117 } | 117 } |
118 #endif | 118 #endif |
119 }; | 119 }; |
120 | 120 |
121 #endif // BASE_MULTIPROCESS_TEST_H_ | 121 #endif // BASE_MULTIPROCESS_TEST_H__ |
OLD | NEW |