diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 20:38:57 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 20:38:57 +0000 |
commit | 49420ffb6ce5a31ed48d1212bd0db878c2c6b7d2 (patch) | |
tree | d37ac5ddf281a412ee5cdc78156c1862ce1f1cce /chrome_frame/test | |
parent | edbfcaa99df9fce2d0f246217b118ee3e58d1146 (diff) | |
download | chromium_src-49420ffb6ce5a31ed48d1212bd0db878c2c6b7d2.zip chromium_src-49420ffb6ce5a31ed48d1212bd0db878c2c6b7d2.tar.gz chromium_src-49420ffb6ce5a31ed48d1212bd0db878c2c6b7d2.tar.bz2 |
Another attempt to fix the Extract build failures on the IE8 builder. Removed the message
pump we spin at the end of each test and replaced it with a simple Wait on the process handle.
Use the KillProcesses helper function in base to terminate running iexplore processes.
Review URL: http://codereview.chromium.org/3419022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r-- | chrome_frame/test/ie_event_sink.cc | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc index 65e0a41..ec0fc5d 100644 --- a/chrome_frame/test/ie_event_sink.cc +++ b/chrome_frame/test/ie_event_sink.cc @@ -138,50 +138,20 @@ void IEEventSink::Uninitialize() { } ScopedHandle process; - process.Set(OpenProcess(SYNCHRONIZE, FALSE, ie_process_id_)); - DLOG_IF(WARNING, !process.IsValid()) - << StringPrintf("OpenProcess failed: %i", ::GetLastError()); - + process.Set(OpenProcess(SYNCHRONIZE, FALSE, + ie_process_id_)); web_browser2_.Release(); + if (!process.IsValid()) { + DLOG_IF(WARNING, !process.IsValid()) + << StringPrintf("OpenProcess failed: %i", ::GetLastError()); + return; + } // IE may not have closed yet. Wait here for the process to finish. // This is necessary at least on some browser/platform configurations. - if (process) { - DWORD max_wait = kDefaultWaitForIEToTerminateMs; - while (true) { - base::Time start = base::Time::Now(); - HANDLE wait_for = process; - DWORD wait = MsgWaitForMultipleObjects(1, &wait_for, FALSE, max_wait, - QS_ALLINPUT); - if (wait == WAIT_OBJECT_0 + 1) { - MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, TRUE) > 0) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } else if (wait == WAIT_OBJECT_0) { - break; - } else { - DCHECK(wait == WAIT_TIMEOUT); - DLOG(ERROR) << "Wait for IE timed out"; - if (!TerminateProcess(process, 0)) { - DLOG(ERROR) << "Failed to terminate IE. Error:" - << ::GetLastError(); - } - break; - } - base::TimeDelta elapsed = base::Time::Now() - start; - ULARGE_INTEGER ms; - ms.QuadPart = elapsed.InMilliseconds(); - DCHECK_EQ(ms.HighPart, 0U); - if (ms.LowPart > max_wait) { - DLOG(ERROR) << "Wait for IE timed out (2)"; - break; - } else { - max_wait -= ms.LowPart; - } - } - } + WaitForSingleObject(process, kDefaultWaitForIEToTerminateMs); + base::KillProcesses(chrome_frame_test::kIEImageName, 0, NULL); + base::KillProcesses(chrome_frame_test::kIEBrokerImageName, 0, NULL); } } |