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 "chrome_frame/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlwin.h> | 8 #include <atlwin.h> |
9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
10 #include <sddl.h> | 10 #include <sddl.h> |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return false; | 546 return false; |
547 } | 547 } |
548 } | 548 } |
549 | 549 |
550 Sleep(10); | 550 Sleep(10); |
551 } | 551 } |
552 } | 552 } |
553 | 553 |
554 base::ProcessHandle StartCrashService() { | 554 base::ProcessHandle StartCrashService() { |
555 if (DetectRunningCrashService(kCrashServiceStartupTimeoutMs)) { | 555 if (DetectRunningCrashService(kCrashServiceStartupTimeoutMs)) { |
556 DLOG(INFO) << "crash_service.exe is already running. We will use the " | 556 DVLOG(1) << "crash_service.exe is already running. We will use the " |
557 << "existing process and leave it running after tests complete."; | 557 "existing process and leave it running after tests complete."; |
558 return NULL; | 558 return NULL; |
559 } | 559 } |
560 | 560 |
561 FilePath exe_dir; | 561 FilePath exe_dir; |
562 if (!PathService::Get(base::DIR_EXE, &exe_dir)) { | 562 if (!PathService::Get(base::DIR_EXE, &exe_dir)) { |
563 DCHECK(false); | 563 DCHECK(false); |
564 return NULL; | 564 return NULL; |
565 } | 565 } |
566 | 566 |
567 base::ProcessHandle crash_service = NULL; | 567 base::ProcessHandle crash_service = NULL; |
568 | 568 |
569 DLOG(INFO) << "Starting crash_service.exe so you know if a test crashes!"; | 569 DVLOG(1) << "Starting crash_service.exe so you know if a test crashes!"; |
570 | 570 |
571 FilePath crash_service_path = exe_dir.AppendASCII("crash_service.exe"); | 571 FilePath crash_service_path = exe_dir.AppendASCII("crash_service.exe"); |
572 if (!base::LaunchApp(crash_service_path.value(), false, false, | 572 if (!base::LaunchApp(crash_service_path.value(), false, false, |
573 &crash_service)) { | 573 &crash_service)) { |
574 DLOG(ERROR) << "Couldn't start crash_service.exe"; | 574 DLOG(ERROR) << "Couldn't start crash_service.exe"; |
575 return NULL; | 575 return NULL; |
576 } | 576 } |
577 | 577 |
578 base::Time start = base::Time::Now(); | 578 base::Time start = base::Time::Now(); |
579 | 579 |
580 if (DetectRunningCrashService(kCrashServiceStartupTimeoutMs)) { | 580 if (DetectRunningCrashService(kCrashServiceStartupTimeoutMs)) { |
581 DLOG(INFO) << "crash_service.exe is ready for clients in " | 581 DVLOG(1) << "crash_service.exe is ready for clients in " |
582 << (base::Time::Now() - start).InMilliseconds() << "ms."; | 582 << (base::Time::Now() - start).InMilliseconds() << " ms."; |
583 return crash_service; | 583 return crash_service; |
584 } else { | 584 } else { |
585 DLOG(ERROR) << "crash_service.exe failed to accept client connections " | 585 DLOG(ERROR) << "crash_service.exe failed to accept client connections " |
586 << "within " << kCrashServiceStartupTimeoutMs << "ms. " | 586 "within " << kCrashServiceStartupTimeoutMs << " ms. " |
587 << "Terminating it now."; | 587 "Terminating it now."; |
588 | 588 |
589 // First check to see if it's even still running just to minimize the | 589 // First check to see if it's even still running just to minimize the |
590 // likelihood of spurious error messages from KillProcess. | 590 // likelihood of spurious error messages from KillProcess. |
591 if (WAIT_OBJECT_0 != ::WaitForSingleObject(crash_service, 0)) { | 591 if (WAIT_OBJECT_0 != ::WaitForSingleObject(crash_service, 0)) { |
592 base::KillProcess(crash_service, 0, false); | 592 base::KillProcess(crash_service, 0, false); |
593 } | 593 } |
594 return NULL; | 594 return NULL; |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
598 } // namespace chrome_frame_test | 598 } // namespace chrome_frame_test |
OLD | NEW |