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

Unified Diff: ipc/ipc_channel_posix_unittest.cc

Issue 7743001: There are times on the Mac when pipe names of 0 length may occur. Let the caller handle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698