summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_multiprocess_test.cc
blob: 8da67b2c8a689cb5d675452c0dc5ff604f2816d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "build/build_config.h"

#include "ipc/ipc_channel.h"
#include "ipc/ipc_multiprocess_test.h"

#if defined(OS_POSIX)
#include "base/posix/global_descriptors.h"
#include "ipc/ipc_descriptors.h"
#endif

namespace internal {

void MultiProcessTestIPCSetUp() {
#if defined(OS_ANDROID)
  // On Android we can't 'exec'. So for simple multi-process tests
  // we need to reset some global data after forking to get the same
  // behavior in simple multi-process tests.
  IPC::Channel::NotifyProcessForkedForTesting();
#endif
#if defined(OS_POSIX)
  base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
      kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
#endif
}

}  // namespace internal