Don't hang in WebKitAPITest if no messages have been posted
[WebKit-https.git] / WebKitTools / WebKitAPITest / tests / WebViewDestruction.cpp
index 928dda5..53f4eb4 100644 (file)
@@ -68,7 +68,7 @@ static void runMessagePump(DWORD timeoutMilliseconds)
     DWORD startTickCount = GetTickCount();
     MSG msg;
     BOOL result;
-    while ((result = GetMessage(&msg, 0, 0, 0)) && GetTickCount() - startTickCount <= timeoutMilliseconds) {
+    while ((result = PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) && GetTickCount() - startTickCount <= timeoutMilliseconds) {
         if (result == -1)
             break;
         TranslateMessage(&msg);