| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "chrome/test/mini_installer_test/mini_installer_test_util.h" | 7 #include "chrome/test/mini_installer_test/mini_installer_test_util.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 key.ki.wScan = 0; | 86 key.ki.wScan = 0; |
| 87 key.ki.dwExtraInfo = 0; | 87 key.ki.dwExtraInfo = 0; |
| 88 SendInput(1, &key, sizeof(INPUT)); | 88 SendInput(1, &key, sizeof(INPUT)); |
| 89 key.ki.dwExtraInfo = KEYEVENTF_KEYUP; | 89 key.ki.dwExtraInfo = KEYEVENTF_KEYUP; |
| 90 SendInput(1, &key, sizeof(INPUT)); | 90 SendInput(1, &key, sizeof(INPUT)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 | 93 |
| 94 void MiniInstallerTestUtil::VerifyProcessLaunch( | 94 void MiniInstallerTestUtil::VerifyProcessLaunch( |
| 95 const wchar_t* process_name, bool expected_status) { | 95 const wchar_t* process_name, bool expected_status) { |
| 96 LOG(INFO) << "Verifying process is launched: " << process_name; |
| 96 int timer = 0, wait_time = 60000; | 97 int timer = 0, wait_time = 60000; |
| 97 if (!expected_status) | 98 if (!expected_status) |
| 98 wait_time = 8000; | 99 wait_time = 8000; |
| 99 | 100 |
| 100 while ((base::GetProcessCount(process_name, NULL) == 0) && | 101 while ((base::GetProcessCount(process_name, NULL) == 0) && |
| 101 (timer < wait_time)) { | 102 (timer < wait_time)) { |
| 102 base::PlatformThread::Sleep(200); | 103 base::PlatformThread::Sleep(200); |
| 103 timer = timer + 200; | 104 timer = timer + 200; |
| 104 } | 105 } |
| 105 | 106 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 125 } | 126 } |
| 126 return true; | 127 return true; |
| 127 } | 128 } |
| 128 | 129 |
| 129 bool MiniInstallerTestUtil::VerifyProcessHandleClosed( | 130 bool MiniInstallerTestUtil::VerifyProcessHandleClosed( |
| 130 base::ProcessHandle handle) { | 131 base::ProcessHandle handle) { |
| 131 DWORD result = WaitForSingleObject(handle, | 132 DWORD result = WaitForSingleObject(handle, |
| 132 TestTimeouts::large_test_timeout_ms()); | 133 TestTimeouts::large_test_timeout_ms()); |
| 133 return result == WAIT_OBJECT_0; | 134 return result == WAIT_OBJECT_0; |
| 134 } | 135 } |
| OLD | NEW |