| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 ASSERT_TRUE(chan.Send(message)); | 99 ASSERT_TRUE(chan.Send(message)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Run message loop. | 102 // Run message loop. |
| 103 MessageLoop::current()->Run(); | 103 MessageLoop::current()->Run(); |
| 104 | 104 |
| 105 // Close Channel so client gets its OnChannelError() callback fired. | 105 // Close Channel so client gets its OnChannelError() callback fired. |
| 106 chan.Close(); | 106 chan.Close(); |
| 107 | 107 |
| 108 // Cleanup child process. | 108 // Cleanup child process. |
| 109 EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000)); | 109 EXPECT_TRUE(base::WaitForSingleProcess( |
| 110 process_handle, base::TimeDelta::FromSeconds(5))); |
| 110 } | 111 } |
| 111 | 112 |
| 112 int TestDescriptorClient(ino_t expected_inode_num) { | 113 int TestDescriptorClient(ino_t expected_inode_num) { |
| 113 MessageLoopForIO main_message_loop; | 114 MessageLoopForIO main_message_loop; |
| 114 MyChannelDescriptorListener listener(expected_inode_num); | 115 MyChannelDescriptorListener listener(expected_inode_num); |
| 115 | 116 |
| 116 // Setup IPC channel. | 117 // Setup IPC channel. |
| 117 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT, | 118 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT, |
| 118 &listener); | 119 &listener); |
| 119 CHECK(chan.Connect()); | 120 CHECK(chan.Connect()); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER, | 195 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER, |
| 195 &listener); | 196 &listener); |
| 196 ASSERT_TRUE(chan.Connect()); | 197 ASSERT_TRUE(chan.Connect()); |
| 197 | 198 |
| 198 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT, | 199 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT, |
| 199 &chan); | 200 &chan); |
| 200 TestDescriptorServer(chan, process_handle); | 201 TestDescriptorServer(chan, process_handle); |
| 201 } | 202 } |
| 202 | 203 |
| 203 #endif // defined(OS_POSIX) | 204 #endif // defined(OS_POSIX) |
| OLD | NEW |