Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2218)

Unified Diff: base/test/multiprocess_test.cc

Issue 104803007: Add a MultiProcessTest::SpawnChildWithOptions(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better comment Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/multiprocess_test.h ('k') | base/test/multiprocess_test_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/multiprocess_test.cc
diff --git a/base/test/multiprocess_test.cc b/base/test/multiprocess_test.cc
index 27f997077b92fa4da39dde3ad97cb071661e7f2a..e1ce7f871ea5e807a78c65fdecd66ae843e534e0 100644
--- a/base/test/multiprocess_test.cc
+++ b/base/test/multiprocess_test.cc
@@ -14,16 +14,32 @@ MultiProcessTest::MultiProcessTest() {
ProcessHandle MultiProcessTest::SpawnChild(const std::string& procname,
bool debug_on_start) {
- FileHandleMappingVector empty_file_list;
- return SpawnChildImpl(procname, empty_file_list, debug_on_start);
+ LaunchOptions options;
+#if defined(OS_WIN)
+ options.start_hidden = true;
+#endif
+ return SpawnChildWithOptions(procname, options, debug_on_start);
+}
+
+#if !defined(OS_ANDROID)
+ProcessHandle MultiProcessTest::SpawnChildWithOptions(
+ const std::string& procname,
+ const LaunchOptions& options,
+ bool debug_on_start) {
+ ProcessHandle handle = kNullProcessHandle;
+ LaunchProcess(MakeCmdLine(procname, debug_on_start), options, &handle);
+ return handle;
}
+#endif
#if defined(OS_POSIX)
ProcessHandle MultiProcessTest::SpawnChild(
const std::string& procname,
const FileHandleMappingVector& fds_to_map,
bool debug_on_start) {
- return SpawnChildImpl(procname, fds_to_map, debug_on_start);
+ LaunchOptions options;
+ options.fds_to_remap = &fds_to_map;
+ return SpawnChildWithOptions(procname, options, debug_on_start);
}
#endif
@@ -36,21 +52,4 @@ CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname,
return cl;
}
-#if !defined(OS_ANDROID)
-ProcessHandle MultiProcessTest::SpawnChildImpl(
- const std::string& procname,
- const FileHandleMappingVector& fds_to_map,
- bool debug_on_start) {
- ProcessHandle handle = kNullProcessHandle;
- base::LaunchOptions options;
-#if defined(OS_WIN)
- options.start_hidden = true;
-#else
- options.fds_to_remap = &fds_to_map;
-#endif
- base::LaunchProcess(MakeCmdLine(procname, debug_on_start), options, &handle);
- return handle;
-}
-#endif // !defined(OS_ANDROID)
-
} // namespace base
« no previous file with comments | « base/test/multiprocess_test.h ('k') | base/test/multiprocess_test_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698