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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
11 #include <unistd.h> | 11 #include <unistd.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include <stdio.h> | |
15 #include <string> | 14 #include <string> |
16 #include <utility> | |
17 | |
18 #include "ipc/ipc_test_base.h" | |
19 | 15 |
20 #include "base/base_switches.h" | 16 #include "base/base_switches.h" |
21 #include "base/command_line.h" | 17 #include "base/command_line.h" |
22 #include "base/debug/debug_on_start_win.h" | 18 #include "base/debug/debug_on_start_win.h" |
23 #include "base/perftimer.h" | 19 #include "base/perftimer.h" |
24 #include "base/pickle.h" | 20 #include "base/pickle.h" |
25 #include "base/test/perf_test_suite.h" | |
26 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
27 #include "base/time.h" | 22 #include "base/time.h" |
28 #include "ipc/ipc_descriptors.h" | 23 #include "ipc/ipc_descriptors.h" |
29 #include "ipc/ipc_channel.h" | 24 #include "ipc/ipc_channel.h" |
30 #include "ipc/ipc_channel_proxy.h" | 25 #include "ipc/ipc_channel_proxy.h" |
31 #include "ipc/ipc_message_utils.h" | 26 #include "ipc/ipc_message_utils.h" |
32 #include "ipc/ipc_multiprocess_test.h" | 27 #include "ipc/ipc_multiprocess_test.h" |
33 #include "ipc/ipc_sender.h" | 28 #include "ipc/ipc_sender.h" |
34 #include "ipc/ipc_switches.h" | 29 #include "ipc/ipc_test_base.h" |
35 #include "testing/multiprocess_func_list.h" | 30 #include "testing/multiprocess_func_list.h" |
36 | 31 |
37 // This test times the roundtrip IPC message cycle. It is enabled with a | 32 // This test times the roundtrip IPC message cycle. It is enabled with a |
38 // special preprocessor define to enable it instead of the standard IPC | 33 // special preprocessor define to enable it instead of the standard IPC |
39 // unit tests. This works around some funny termination conditions in the | 34 // unit tests. This works around some funny termination conditions in the |
40 // regular unit tests. | 35 // regular unit tests. |
41 // | 36 // |
42 // This test is not automated. To test, you will want to vary the message | 37 // This test is not automated. To test, you will want to vary the message |
43 // count and message size in TEST to get the numbers you want. | 38 // count and message size in TEST to get the numbers you want. |
44 // | 39 // |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 MULTIPROCESS_IPC_TEST_MAIN(RunReflector) { | 191 MULTIPROCESS_IPC_TEST_MAIN(RunReflector) { |
197 MessageLoopForIO main_message_loop; | 192 MessageLoopForIO main_message_loop; |
198 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL); | 193 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL); |
199 ChannelReflectorListener channel_reflector_listener(&chan); | 194 ChannelReflectorListener channel_reflector_listener(&chan); |
200 chan.set_listener(&channel_reflector_listener); | 195 chan.set_listener(&channel_reflector_listener); |
201 CHECK(chan.Connect()); | 196 CHECK(chan.Connect()); |
202 | 197 |
203 MessageLoop::current()->Run(); | 198 MessageLoop::current()->Run(); |
204 return 0; | 199 return 0; |
205 } | 200 } |
OLD | NEW |