OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <iostream> | 7 #include <iostream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/common/ipc_tests.h" | 10 #include "chrome/common/ipc_tests.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 CommandLine::AppendSwitch(&cl, switches::kDebugOnStart); | 371 CommandLine::AppendSwitch(&cl, switches::kDebugOnStart); |
372 } | 372 } |
373 HANDLE process = NULL; | 373 HANDLE process = NULL; |
374 if (!process_util::LaunchApp(cl, false, true, &process)) | 374 if (!process_util::LaunchApp(cl, false, true, &process)) |
375 return NULL; | 375 return NULL; |
376 | 376 |
377 return process; | 377 return process; |
378 } | 378 } |
379 | 379 |
380 int main(int argc, char** argv) { | 380 int main(int argc, char** argv) { |
| 381 process_util::EnableTerminationOnHeapCorruption(); |
381 // Some tests may use base::Singleton<>, thus we need to instanciate | 382 // Some tests may use base::Singleton<>, thus we need to instanciate |
382 // the AtExitManager or else we will leak objects. | 383 // the AtExitManager or else we will leak objects. |
383 base::AtExitManager at_exit_manager; | 384 base::AtExitManager at_exit_manager; |
384 | 385 |
385 MessageLoopForIO main_message_loop; | 386 MessageLoopForIO main_message_loop; |
386 | 387 |
387 // suppress standard crash dialogs and such unless a debugger is present. | 388 // suppress standard crash dialogs and such unless a debugger is present. |
388 if (!IsDebuggerPresent()) { | 389 if (!IsDebuggerPresent()) { |
389 SuppressErrorDialogs(); | 390 SuppressErrorDialogs(); |
390 logging::SetLogAssertHandler(IPCTestAssertHandler); | 391 logging::SetLogAssertHandler(IPCTestAssertHandler); |
391 } | 392 } |
392 | 393 |
393 #ifndef PERFORMANCE_TEST | 394 #ifndef PERFORMANCE_TEST |
394 if (CommandLine().HasSwitch(kChild)) | 395 if (CommandLine().HasSwitch(kChild)) |
395 return RunTestClient(); | 396 return RunTestClient(); |
396 if (CommandLine().HasSwitch(kFuzzer)) | 397 if (CommandLine().HasSwitch(kFuzzer)) |
397 return RunFuzzServer(); | 398 return RunFuzzServer(); |
398 #else | 399 #else |
399 if (CommandLine().HasSwitch(kReflector)) | 400 if (CommandLine().HasSwitch(kReflector)) |
400 return RunReflector(); | 401 return RunReflector(); |
401 | 402 |
402 if (!InitPerfLog("ipc_perf_child.log")) | 403 if (!InitPerfLog("ipc_perf_child.log")) |
403 return 1; | 404 return 1; |
404 #endif | 405 #endif |
405 | 406 |
406 testing::InitGoogleTest(&argc, argv); | 407 testing::InitGoogleTest(&argc, argv); |
407 return RUN_ALL_TESTS(); | 408 return RUN_ALL_TESTS(); |
408 } | 409 } |
409 | 410 |
OLD | NEW |