OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/sync_socket.h" | 5 #include "base/sync_socket.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string> | 8 #include <string> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "ipc/ipc_channel.h" | 14 #include "ipc/ipc_channel.h" |
15 #include "ipc/ipc_channel_proxy.h" | 15 #include "ipc/ipc_channel_proxy.h" |
16 #include "ipc/ipc_message_macros.h" | 16 #include "ipc/ipc_message_macros.h" |
17 #include "ipc/ipc_message_utils.h" | 17 #include "ipc/ipc_message_utils.h" |
18 #include "ipc/ipc_message_utils_impl.h" | 18 #include "ipc/ipc_message_utils_impl.h" |
19 #include "ipc/ipc_tests.h" | 19 #include "ipc/ipc_tests.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "testing/multiprocess_func_list.h" | 21 #include "testing/multiprocess_func_list.h" |
22 | 22 |
23 #if defined(OS_LINUX) || defined(OS_MACOSX) | 23 #if defined(OS_POSIX) |
24 #include "base/file_descriptor_posix.h" | 24 #include "base/file_descriptor_posix.h" |
25 #endif // defined(OS_LINUX) || defined(OS_MACOSX) | 25 #endif |
26 | 26 |
27 enum IPCMessageIds { | 27 enum IPCMessageIds { |
28 UNUSED_IPC_TYPE, | 28 UNUSED_IPC_TYPE, |
29 SERVER_FIRST_IPC_TYPE, // SetHandle message sent to server. | 29 SERVER_FIRST_IPC_TYPE, // SetHandle message sent to server. |
30 SERVER_SECOND_IPC_TYPE, // Shutdown message sent to server. | 30 SERVER_SECOND_IPC_TYPE, // Shutdown message sent to server. |
31 CLIENT_FIRST_IPC_TYPE // Response message sent to client. | 31 CLIENT_FIRST_IPC_TYPE // Response message sent to client. |
32 }; | 32 }; |
33 | 33 |
34 namespace { | 34 namespace { |
35 const char kHelloString[] = "Hello, SyncSocket Client"; | 35 const char kHelloString[] = "Hello, SyncSocket Client"; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 #endif // defined(OS_WIN) | 241 #endif // defined(OS_WIN) |
242 EXPECT_TRUE(chan.Send(msg)); | 242 EXPECT_TRUE(chan.Send(msg)); |
243 // Use the current thread as the I/O thread. | 243 // Use the current thread as the I/O thread. |
244 MessageLoop::current()->Run(); | 244 MessageLoop::current()->Run(); |
245 // Shut down. | 245 // Shut down. |
246 delete pair[0]; | 246 delete pair[0]; |
247 delete pair[1]; | 247 delete pair[1]; |
248 EXPECT_TRUE(base::WaitForSingleProcess(server_process, 5000)); | 248 EXPECT_TRUE(base::WaitForSingleProcess(server_process, 5000)); |
249 base::CloseProcessHandle(server_process); | 249 base::CloseProcessHandle(server_process); |
250 } | 250 } |
OLD | NEW |