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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 switch (::GetLastError()) { | 559 switch (::GetLastError()) { |
560 case ERROR_PIPE_BUSY: | 560 case ERROR_PIPE_BUSY: |
561 // OK, it exists, let's assume that clients will eventually be able to | 561 // OK, it exists, let's assume that clients will eventually be able to |
562 // connect to it. | 562 // connect to it. |
563 return true; | 563 return true; |
564 case ERROR_FILE_NOT_FOUND: | 564 case ERROR_FILE_NOT_FOUND: |
565 // Wait a bit longer | 565 // Wait a bit longer |
566 break; | 566 break; |
567 default: | 567 default: |
568 DLOG(WARNING) << "Unexpected error while checking crash_service.exe's " | 568 DLOG(WARNING) << "Unexpected error while checking crash_service.exe's " |
569 << "pipe: " << win_util::FormatLastWin32Error(); | 569 ::GetLastError(); |
570 // Go ahead and wait in case it clears up. | 570 // Go ahead and wait in case it clears up. |
571 break; | 571 break; |
572 } | 572 } |
573 | 573 |
574 if (timeout_ms == 0) { | 574 if (timeout_ms == 0) { |
575 return false; | 575 return false; |
576 } else if (timeout_ms > 0) { | 576 } else if (timeout_ms > 0) { |
577 base::TimeDelta duration = base::Time::Now() - start; | 577 base::TimeDelta duration = base::Time::Now() - start; |
578 if (duration.InMilliseconds() > timeout_ms) { | 578 if (duration.InMilliseconds() > timeout_ms) { |
579 return false; | 579 return false; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 bool wait) { | 668 bool wait) { |
669 bool result = true; | 669 bool result = true; |
670 base::NamedProcessIterator iter(executable_name, NULL); | 670 base::NamedProcessIterator iter(executable_name, NULL); |
671 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { | 671 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { |
672 result &= base::KillProcessById(entry->pid(), exit_code, wait); | 672 result &= base::KillProcessById(entry->pid(), exit_code, wait); |
673 } | 673 } |
674 return result; | 674 return result; |
675 } | 675 } |
676 | 676 |
677 } // namespace chrome_frame_test | 677 } // namespace chrome_frame_test |
OLD | NEW |