summaryrefslogtreecommitdiffstats
path: root/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2010-11-10 15:31:59 -0800
committerTeng-Hui Zhu <ztenghui@google.com>2010-11-17 13:35:59 -0800
commit28040489d744e0c5d475a88663056c9040ed5320 (patch)
treec463676791e4a63e452a95f0a12b2a8519730693 /WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
parenteff9be92c41913c92fb1d3b7983c071f3e718678 (diff)
downloadexternal_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp')
-rw-r--r--WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index 9643c40..3fd853f 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -120,15 +120,25 @@ void TestController::initializeTestPluginDirectory()
m_testPluginDirectory.adopt(WKStringCreateWithCFString(testPluginDirectoryPath.get()));
}
-void TestController::runUntil(bool& done)
+void TestController::platformRunUntil(bool& done, double timeout)
{
+ DWORD end = ::GetTickCount() + timeout * 1000;
while (!done) {
- MSG msg;
- BOOL result = GetMessage(&msg, 0, 0, 0);
- if (result == -1)
+ DWORD now = ::GetTickCount();
+ if (now > end)
+ return;
+
+ DWORD result = ::MsgWaitForMultipleObjectsEx(0, 0, end - now, QS_ALLINPUT, 0);
+ if (result == WAIT_TIMEOUT)
return;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
+
+ ASSERT(result == WAIT_OBJECT_0);
+ // There are messages in the queue. Process them.
+ MSG msg;
+ while (::PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessageW(&msg);
+ }
}
}