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