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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 MyChannelListener channel_listener; | 289 MyChannelListener channel_listener; |
290 | 290 |
291 // The thread needs to out-live the ChannelProxy. | 291 // The thread needs to out-live the ChannelProxy. |
292 base::Thread thread("ChannelProxyTestServer"); | 292 base::Thread thread("ChannelProxyTestServer"); |
293 base::Thread::Options options; | 293 base::Thread::Options options; |
294 options.message_loop_type = MessageLoop::TYPE_IO; | 294 options.message_loop_type = MessageLoop::TYPE_IO; |
295 thread.StartWithOptions(options); | 295 thread.StartWithOptions(options); |
296 { | 296 { |
297 // setup IPC channel proxy | 297 // setup IPC channel proxy |
298 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER, | 298 IPC::ChannelProxy chan(kTestClientChannel, IPC::Channel::MODE_SERVER, |
299 &channel_listener, thread.message_loop_proxy()); | 299 &channel_listener, |
| 300 thread.message_loop_proxy().get()); |
300 | 301 |
301 channel_listener.Init(&chan); | 302 channel_listener.Init(&chan); |
302 | 303 |
303 #if defined(OS_WIN) | 304 #if defined(OS_WIN) |
304 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); | 305 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); |
305 #elif defined(OS_POSIX) | 306 #elif defined(OS_POSIX) |
306 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( | 307 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( |
307 switches::kDebugChildren); | 308 switches::kDebugChildren); |
308 base::FileHandleMappingVector fds_to_map; | 309 base::FileHandleMappingVector fds_to_map; |
309 const int ipcfd = chan.GetClientFileDescriptor(); | 310 const int ipcfd = chan.GetClientFileDescriptor(); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 #endif // PERFORMANCE_TEST | 592 #endif // PERFORMANCE_TEST |
592 | 593 |
593 int main(int argc, char** argv) { | 594 int main(int argc, char** argv) { |
594 #ifdef PERFORMANCE_TEST | 595 #ifdef PERFORMANCE_TEST |
595 int retval = base::PerfTestSuite(argc, argv).Run(); | 596 int retval = base::PerfTestSuite(argc, argv).Run(); |
596 #else | 597 #else |
597 int retval = base::TestSuite(argc, argv).Run(); | 598 int retval = base::TestSuite(argc, argv).Run(); |
598 #endif | 599 #endif |
599 return retval; | 600 return retval; |
600 } | 601 } |
OLD | NEW |