| Index: ipc/ipc_tests.cc
|
| diff --git a/ipc/ipc_tests.cc b/ipc/ipc_tests.cc
|
| index 763a59278e6dd17999f59769db868e9dde510ccc..18d7dcc6fc9c3dbdda32fd5460c60f20b37fbb51 100644
|
| --- a/ipc/ipc_tests.cc
|
| +++ b/ipc/ipc_tests.cc
|
| @@ -32,6 +32,11 @@
|
| #include "ipc/ipc_switches.h"
|
| #include "testing/multiprocess_func_list.h"
|
|
|
| +#if defined(OS_POSIX)
|
| +#include "base/global_descriptors_posix.h"
|
| +#include "ipc/ipc_descriptors.h"
|
| +#endif
|
| +
|
| // Define to enable IPC performance testing instead of the regular unit tests
|
| // #define PERFORMANCE_TEST
|
|
|
| @@ -44,6 +49,14 @@ const size_t kLongMessageStringNumBytes = 50000;
|
|
|
| #ifndef PERFORMANCE_TEST
|
|
|
| +int MultiProcessTestIPCSetUp() {
|
| +#if defined(OS_POSIX)
|
| + base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
|
| + kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
|
| +#endif
|
| + return 0;
|
| +}
|
| +
|
| void IPCChannelTest::SetUp() {
|
| MultiProcessTest::SetUp();
|
|
|
| @@ -402,7 +415,7 @@ TEST_F(IPCChannelTest, MAYBE_SendMessageInChannelConnected) {
|
| base::CloseProcessHandle(process_handle);
|
| }
|
|
|
| -MULTIPROCESS_TEST_MAIN(RunTestClient) {
|
| +MULTIPROCESS_TEST_MAIN(RunTestClient, MultiProcessTestIPCSetUp) {
|
| MessageLoopForIO main_message_loop;
|
| MyChannelListener channel_listener;
|
|
|
| @@ -572,7 +585,11 @@ TEST_F(IPCChannelTest, Performance) {
|
| }
|
|
|
| // This message loop bounces all messages back to the sender
|
| -MULTIPROCESS_TEST_MAIN(RunReflector) {
|
| +MULTIPROCESS_TEST_MAIN(RunReflector, MultiProcessTestIPCSetUp) {
|
| +#if defined(OS_POSIX)
|
| + base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
|
| + kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
|
| +#endif
|
| MessageLoopForIO main_message_loop;
|
| IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL);
|
| ChannelReflectorListener channel_reflector_listener(&chan);
|
|
|