Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ipc / ipc_multiprocess_test.cc
blob8da67b2c8a689cb5d675452c0dc5ff604f2816d2
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 "build/build_config.h"
7 #include "ipc/ipc_channel.h"
8 #include "ipc/ipc_multiprocess_test.h"
10 #if defined(OS_POSIX)
11 #include "base/posix/global_descriptors.h"
12 #include "ipc/ipc_descriptors.h"
13 #endif
15 namespace internal {
17 void MultiProcessTestIPCSetUp() {
18 #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
24 #if defined(OS_POSIX)
25 base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
26 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
27 #endif
30 } // namespace internal