Index: ipc/ipc_channel_posix_unittest.cc |
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc |
index 14ecc6083e541792e69053febbd1c10b3dcdf28b..9fd449c34d56949ba03311bfa9c5e0b9466c4e8d 100644 |
--- a/ipc/ipc_channel_posix_unittest.cc |
+++ b/ipc/ipc_channel_posix_unittest.cc |
@@ -281,6 +281,25 @@ TEST_F(IPCChannelPosixTest, ResetState) { |
ASSERT_FALSE(channel.HasAcceptedConnection()); |
} |
+TEST_F(IPCChannelPosixTest, BadChannelName) { |
+ // Test empty name |
+ IPC::ChannelHandle handle(""); |
+ IPC::Channel channel(handle, IPC::Channel::MODE_NAMED_SERVER, NULL); |
+ ASSERT_FALSE(channel.Connect()); |
+ |
+ // Test name that is too long. |
+ IPC::ChannelHandle handle2("This_is_a_very_long_name_that_must_be_more_than" |
Mark Mentovai
2011/08/25 13:11:02
Do “const char kTooLongName[] = This_is_a_very_lon
|
+ "104_characters_in_length____Proactively_implement" |
+ "client-centered_synergy_through_top-line" |
+ "platforms_Phosfluorescently_disintermediate_" |
+ "clicks-and-mortar_best_practices_without_" |
+ "future-proof_growth_strategies_Continually" |
+ "pontificate_proactive_potentialities_before" |
+ "leading-edge_processes"); |
jeremy
2011/08/25 07:16:51
_with_a_cherry_on_top :o)
|
+ IPC::Channel channel2(handle2, IPC::Channel::MODE_NAMED_SERVER, NULL); |
+ ASSERT_FALSE(channel2.Connect()); |
Mark Mentovai
2011/08/25 13:11:02
Note that the suggested size checks could be ASSER
|
+} |
+ |
TEST_F(IPCChannelPosixTest, MultiConnection) { |
// Test setting up a connection to an external process, and then have |
// another external process attempt to connect to us. |