| 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> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/time.h" | 27 #include "base/time.h" |
| 28 #include "ipc/ipc_descriptors.h" | 28 #include "ipc/ipc_descriptors.h" |
| 29 #include "ipc/ipc_channel.h" | 29 #include "ipc/ipc_channel.h" |
| 30 #include "ipc/ipc_channel_proxy.h" | 30 #include "ipc/ipc_channel_proxy.h" |
| 31 #include "ipc/ipc_message_utils.h" | 31 #include "ipc/ipc_message_utils.h" |
| 32 #include "ipc/ipc_multiprocess_test.h" | 32 #include "ipc/ipc_multiprocess_test.h" |
| 33 #include "ipc/ipc_sender.h" | 33 #include "ipc/ipc_sender.h" |
| 34 #include "ipc/ipc_switches.h" | 34 #include "ipc/ipc_switches.h" |
| 35 #include "testing/multiprocess_func_list.h" | 35 #include "testing/multiprocess_func_list.h" |
| 36 | 36 |
| 37 namespace { |
| 38 |
| 37 // This test times the roundtrip IPC message cycle. It is enabled with a | 39 // 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 | 40 // special preprocessor define to enable it instead of the standard IPC |
| 39 // unit tests. This works around some funny termination conditions in the | 41 // unit tests. This works around some funny termination conditions in the |
| 40 // regular unit tests. | 42 // regular unit tests. |
| 41 // | 43 // |
| 42 // This test is not automated. To test, you will want to vary the message | 44 // 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. | 45 // count and message size in TEST to get the numbers you want. |
| 44 // | 46 // |
| 45 // FIXME(brettw): Automate this test and have it run by default. | 47 // FIXME(brettw): Automate this test and have it run by default. |
| 46 | 48 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 MULTIPROCESS_IPC_TEST_MAIN(RunReflector) { | 198 MULTIPROCESS_IPC_TEST_MAIN(RunReflector) { |
| 197 MessageLoopForIO main_message_loop; | 199 MessageLoopForIO main_message_loop; |
| 198 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL); | 200 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_CLIENT, NULL); |
| 199 ChannelReflectorListener channel_reflector_listener(&chan); | 201 ChannelReflectorListener channel_reflector_listener(&chan); |
| 200 chan.set_listener(&channel_reflector_listener); | 202 chan.set_listener(&channel_reflector_listener); |
| 201 CHECK(chan.Connect()); | 203 CHECK(chan.Connect()); |
| 202 | 204 |
| 203 MessageLoop::current()->Run(); | 205 MessageLoop::current()->Run(); |
| 204 return 0; | 206 return 0; |
| 205 } | 207 } |
| 208 |
| 209 } // namespace |
| OLD | NEW |