blob: 8da67b2c8a689cb5d675452c0dc5ff604f2816d2 [file] [log] [blame]
jcivelli@chromium.orgc30c76f2012-06-27 10:12:24 +09001// 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.
4
5#include "build/build_config.h"
6
epenner@chromium.org913c9482014-03-19 15:34:52 +09007#include "ipc/ipc_channel.h"
jcivelli@chromium.orgc30c76f2012-06-27 10:12:24 +09008#include "ipc/ipc_multiprocess_test.h"
9
10#if defined(OS_POSIX)
brettw@chromium.orgea3b3f22012-11-10 08:46:54 +090011#include "base/posix/global_descriptors.h"
jcivelli@chromium.orgc30c76f2012-06-27 10:12:24 +090012#include "ipc/ipc_descriptors.h"
13#endif
14
viettrungluu@chromium.org00155942013-01-26 06:51:35 +090015namespace internal {
16
jcivelli@chromium.orgc30c76f2012-06-27 10:12:24 +090017void MultiProcessTestIPCSetUp() {
epenner@chromium.org913c9482014-03-19 15:34:52 +090018#if defined(OS_ANDROID)
19 // On Android we can't 'exec'. So for simple multi-process tests
20 // we need to reset some global data after forking to get the same
21 // behavior in simple multi-process tests.
22 IPC::Channel::NotifyProcessForkedForTesting();
23#endif
jcivelli@chromium.orgc30c76f2012-06-27 10:12:24 +090024#if defined(OS_POSIX)
25 base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
26 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
27#endif
28}
viettrungluu@chromium.org00155942013-01-26 06:51:35 +090029
30} // namespace internal