OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |