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 "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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 MyChannelListener channel_listener; | 243 MyChannelListener channel_listener; |
244 | 244 |
245 // The thread needs to out-live the ChannelProxy. | 245 // The thread needs to out-live the ChannelProxy. |
246 base::Thread thread("ChannelProxyTestServer"); | 246 base::Thread thread("ChannelProxyTestServer"); |
247 base::Thread::Options options; | 247 base::Thread::Options options; |
248 options.message_loop_type = MessageLoop::TYPE_IO; | 248 options.message_loop_type = MessageLoop::TYPE_IO; |
249 thread.StartWithOptions(options); | 249 thread.StartWithOptions(options); |
250 { | 250 { |
251 // setup IPC channel proxy | 251 // setup IPC channel proxy |
252 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER, | 252 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER, |
253 &channel_listener, NULL, thread.message_loop()); | 253 &channel_listener, thread.message_loop()); |
254 | 254 |
255 channel_listener.Init(&chan); | 255 channel_listener.Init(&chan); |
256 | 256 |
257 #if defined(OS_WIN) | 257 #if defined(OS_WIN) |
258 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); | 258 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); |
259 #elif defined(OS_POSIX) | 259 #elif defined(OS_POSIX) |
260 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( | 260 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( |
261 switches::kDebugChildren); | 261 switches::kDebugChildren); |
262 base::file_handle_mapping_vector fds_to_map; | 262 base::file_handle_mapping_vector fds_to_map; |
263 const int ipcfd = chan.GetClientFileDescriptor(); | 263 const int ipcfd = chan.GetClientFileDescriptor(); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 #endif // PERFORMANCE_TEST | 533 #endif // PERFORMANCE_TEST |
534 | 534 |
535 int main(int argc, char** argv) { | 535 int main(int argc, char** argv) { |
536 #ifdef PERFORMANCE_TEST | 536 #ifdef PERFORMANCE_TEST |
537 int retval = base::PerfTestSuite(argc, argv).Run(); | 537 int retval = base::PerfTestSuite(argc, argv).Run(); |
538 #else | 538 #else |
539 int retval = base::TestSuite(argc, argv).Run(); | 539 int retval = base::TestSuite(argc, argv).Run(); |
540 #endif | 540 #endif |
541 return retval; | 541 return retval; |
542 } | 542 } |
OLD | NEW |