Index: ipc/ipc_channel_posix_unittest.cc |
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc |
index 459aafb0276a3b8b9e0f5da4f9efbed7525a9224..dcd924e9d41643777cc39cab71eca9e6351e4958 100644 |
--- a/ipc/ipc_channel_posix_unittest.cc |
+++ b/ipc/ipc_channel_posix_unittest.cc |
@@ -318,6 +318,25 @@ TEST_F(IPCChannelPosixTest, MultiConnection) { |
ASSERT_FALSE(channel.HasAcceptedConnection()); |
} |
+TEST_F(IPCChannelPosixTest, DoubleServer) { |
+ // Test setting up two servers with the same name. |
+ IPCChannelPosixTestListener listener(false); |
+ IPCChannelPosixTestListener listener2(false); |
+ IPC::ChannelHandle chan_handle(kConnectionSocketTestName); |
+ IPC::Channel channel(chan_handle, IPC::Channel::MODE_SERVER, &listener); |
+ IPC::Channel channel2(chan_handle, IPC::Channel::MODE_SERVER, &listener2); |
+ ASSERT_TRUE(channel.Connect()); |
+ ASSERT_FALSE(channel2.Connect()); |
+} |
+ |
+TEST_F(IPCChannelPosixTest, BadMode) { |
+ // Test setting up two servers with a bad mode. |
+ IPCChannelPosixTestListener listener(false); |
+ IPC::ChannelHandle chan_handle(kConnectionSocketTestName); |
+ IPC::Channel channel(chan_handle, IPC::Channel::MODE_NONE, &listener); |
+ ASSERT_FALSE(channel.Connect()); |
+} |
+ |
// A long running process that connects to us |
MULTIPROCESS_TEST_MAIN(IPCChannelPosixTestConnectionProc) { |
MessageLoopForIO message_loop; |