Index: ipc/ipc_tests.cc |
diff --git a/ipc/ipc_tests.cc b/ipc/ipc_tests.cc |
index 763a59278e6dd17999f59769db868e9dde510ccc..de08a1595b74273ee1596ce3ad2885a8948d0be3 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_IPC_TEST_MAIN(RunTestClient) { |
MessageLoopForIO main_message_loop; |
MyChannelListener channel_listener; |
@@ -572,7 +585,7 @@ TEST_F(IPCChannelTest, Performance) { |
} |
// This message loop bounces all messages back to the sender |
-MULTIPROCESS_TEST_MAIN(RunReflector) { |
+MULTIPROCESS_IPC_TEST_MAIN(RunReflector) { |
MessageLoopForIO main_message_loop; |
IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL); |
ChannelReflectorListener channel_reflector_listener(&chan); |