OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_proxy(), | 254 &channel_listener, thread.message_loop_proxy()); |
255 false /* needs_override_peer_pid */); | |
256 | 255 |
257 channel_listener.Init(&chan); | 256 channel_listener.Init(&chan); |
258 | 257 |
259 #if defined(OS_WIN) | 258 #if defined(OS_WIN) |
260 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); | 259 base::ProcessHandle process_handle = SpawnChild(TEST_CLIENT, NULL); |
261 #elif defined(OS_POSIX) | 260 #elif defined(OS_POSIX) |
262 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( | 261 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( |
263 switches::kDebugChildren); | 262 switches::kDebugChildren); |
264 base::file_handle_mapping_vector fds_to_map; | 263 base::file_handle_mapping_vector fds_to_map; |
265 const int ipcfd = chan.GetClientFileDescriptor(); | 264 const int ipcfd = chan.GetClientFileDescriptor(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 #endif // PERFORMANCE_TEST | 537 #endif // PERFORMANCE_TEST |
539 | 538 |
540 int main(int argc, char** argv) { | 539 int main(int argc, char** argv) { |
541 #ifdef PERFORMANCE_TEST | 540 #ifdef PERFORMANCE_TEST |
542 int retval = base::PerfTestSuite(argc, argv).Run(); | 541 int retval = base::PerfTestSuite(argc, argv).Run(); |
543 #else | 542 #else |
544 int retval = base::TestSuite(argc, argv).Run(); | 543 int retval = base::TestSuite(argc, argv).Run(); |
545 #endif | 544 #endif |
546 return retval; | 545 return retval; |
547 } | 546 } |
OLD | NEW |