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

Side by Side Diff: ipc/ipc_send_fds_test.cc

Issue 3759004: ipc_channel: warn if someone forgets to check the result of Connect() (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fixes Created 10 years, 2 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "ipc/ipc_tests.h" 7 #include "ipc/ipc_tests.h"
8 8
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 extern "C" { 10 extern "C" {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000)); 103 EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000));
104 } 104 }
105 105
106 int TestDescriptorClient(ino_t expected_inode_num) { 106 int TestDescriptorClient(ino_t expected_inode_num) {
107 MessageLoopForIO main_message_loop; 107 MessageLoopForIO main_message_loop;
108 MyChannelDescriptorListener listener(expected_inode_num); 108 MyChannelDescriptorListener listener(expected_inode_num);
109 109
110 // Setup IPC channel. 110 // Setup IPC channel.
111 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT, 111 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT,
112 &listener); 112 &listener);
113 chan.Connect(); 113 ASSERT_TRUE(chan.Connect());
114 MessageLoop::current()->Run(); 114 MessageLoop::current()->Run();
115 115
116 return 0; 116 return 0;
117 } 117 }
118 118
119 } // namespace 119 } // namespace
120 120
121 // --------------------------------------------------------------------------- 121 // ---------------------------------------------------------------------------
122 #if defined(OS_MACOSX) 122 #if defined(OS_MACOSX)
123 // TODO(port): Make this test cross-platform. 123 // TODO(port): Make this test cross-platform.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER, 182 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER,
183 &listener); 183 &listener);
184 chan.Connect(); 184 chan.Connect();
185 185
186 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT, 186 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT,
187 &chan); 187 &chan);
188 TestDescriptorServer(chan, process_handle); 188 TestDescriptorServer(chan, process_handle);
189 } 189 }
190 190
191 #endif // defined(OS_POSIX) 191 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698