Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: ipc/ipc_tests.cc

Issue 10387218: Make GlobalDescriptors::MaybeGet return -1 when the key is not found. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied Jeremy's suggestions + sync. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698