Remove connection_history.js from remoting's JS tests.
[chromium-blink-merge.git] / base / test / multiprocess_test.cc
blobe1ce7f871ea5e807a78c65fdecd66ae843e534e0
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
3 // found in the LICENSE file.
5 #include "base/test/multiprocess_test.h"
7 #include "base/base_switches.h"
8 #include "base/command_line.h"
10 namespace base {
12 MultiProcessTest::MultiProcessTest() {
15 ProcessHandle MultiProcessTest::SpawnChild(const std::string& procname,
16 bool debug_on_start) {
17 LaunchOptions options;
18 #if defined(OS_WIN)
19 options.start_hidden = true;
20 #endif
21 return SpawnChildWithOptions(procname, options, debug_on_start);
24 #if !defined(OS_ANDROID)
25 ProcessHandle MultiProcessTest::SpawnChildWithOptions(
26 const std::string& procname,
27 const LaunchOptions& options,
28 bool debug_on_start) {
29 ProcessHandle handle = kNullProcessHandle;
30 LaunchProcess(MakeCmdLine(procname, debug_on_start), options, &handle);
31 return handle;
33 #endif
35 #if defined(OS_POSIX)
36 ProcessHandle MultiProcessTest::SpawnChild(
37 const std::string& procname,
38 const FileHandleMappingVector& fds_to_map,
39 bool debug_on_start) {
40 LaunchOptions options;
41 options.fds_to_remap = &fds_to_map;
42 return SpawnChildWithOptions(procname, options, debug_on_start);
44 #endif
46 CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname,
47 bool debug_on_start) {
48 CommandLine cl(*CommandLine::ForCurrentProcess());
49 cl.AppendSwitchASCII(switches::kTestChildProcess, procname);
50 if (debug_on_start)
51 cl.AppendSwitch(switches::kDebugOnStart);
52 return cl;
55 } // namespace base