OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); |
265 if (ipcfd > -1) { | 265 if (ipcfd > -1) { |
266 fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3)); | 266 fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3)); |
267 } | 267 } |
268 | 268 |
269 base::ProcessHandle process_handle = MultiProcessTest::SpawnChild( | 269 base::ProcessHandle process_handle = MultiProcessTest::SpawnChild( |
270 L"RunTestClient", | 270 L"RunTestClient", |
271 fds_to_map, | 271 fds_to_map, |
272 debug_on_start); | 272 debug_on_start); |
273 #endif // defined(OS_POXIX) | 273 #endif // defined(OS_POSIX) |
274 | 274 |
275 ASSERT_TRUE(process_handle); | 275 ASSERT_TRUE(process_handle); |
276 | 276 |
277 Send(&chan, "hello from parent"); | 277 Send(&chan, "hello from parent"); |
278 | 278 |
279 // run message loop | 279 // run message loop |
280 MessageLoop::current()->Run(); | 280 MessageLoop::current()->Run(); |
281 | 281 |
282 // cleanup child process | 282 // cleanup child process |
283 EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000)); | 283 EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000)); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 #endif // PERFORMANCE_TEST | 467 #endif // PERFORMANCE_TEST |
468 | 468 |
469 int main(int argc, char** argv) { | 469 int main(int argc, char** argv) { |
470 #ifdef PERFORMANCE_TEST | 470 #ifdef PERFORMANCE_TEST |
471 int retval = PerfTestSuite(argc, argv).Run(); | 471 int retval = PerfTestSuite(argc, argv).Run(); |
472 #else | 472 #else |
473 int retval = TestSuite(argc, argv).Run(); | 473 int retval = TestSuite(argc, argv).Run(); |
474 #endif | 474 #endif |
475 return retval; | 475 return retval; |
476 } | 476 } |
OLD | NEW |