Don't hang in WebKitAPITest if no messages have been posted
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2010 18:14:35 +0000 (18:14 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2010 18:14:35 +0000 (18:14 +0000)
Part of <http://webkit.org/b/33212> Small fixes/improvements to
WebKitAPITest

Reviewed by Sam Weinig.

* WebKitAPITest/tests/WebViewDestruction.cpp:
(WebKitAPITest::runMessagePump): Use PeekMessage instead of GetMessage
to avoid hanging if no messages have been posted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@52803 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/WebKitAPITest/tests/WebViewDestruction.cpp

index 34cdc85..3528856 100644 (file)
@@ -1,5 +1,18 @@
 2010-01-05  Adam Roben  <aroben@apple.com>
 
+        Don't hang in WebKitAPITest if no messages have been posted
+
+        Part of <http://webkit.org/b/33212> Small fixes/improvements to
+        WebKitAPITest
+
+        Reviewed by Sam Weinig.
+
+        * WebKitAPITest/tests/WebViewDestruction.cpp:
+        (WebKitAPITest::runMessagePump): Use PeekMessage instead of GetMessage
+        to avoid hanging if no messages have been posted.
+
+2010-01-05  Adam Roben  <aroben@apple.com>
+
         Fix WebKitCreateInstance helper
 
         Part of <http://webkit.org/b/33212> Small fixes/improvements to
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);