Francois Gouget : msctf/tests: Give time for the messages to arrive.

Alexandre Julliard julliard at winehq.org
Mon Sep 12 11:42:57 CDT 2011


Module: wine
Branch: master
Commit: 8f8760a1a5af46315b69ed383f64df73d441128a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8f8760a1a5af46315b69ed383f64df73d441128a

Author: Francois Gouget <fgouget at free.fr>
Date:   Sun Sep 11 23:16:59 2011 +0200

msctf/tests: Give time for the messages to arrive.

---

 dlls/msctf/tests/inputprocessor.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 3262c6b..8f409c3 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -1993,9 +1993,20 @@ static void test_Compartments(void)
 static void processPendingMessages(void)
 {
     MSG msg;
-    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
-        TranslateMessage(&msg);
-        DispatchMessage(&msg);
+    int diff = 200;
+    int min_timeout = 100;
+    DWORD time = GetTickCount() + diff;
+
+    while (diff > 0)
+    {
+        if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT)
+            break;
+        while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+        {
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+        }
+        diff = time - GetTickCount();
     }
 }
 




More information about the wine-cvs mailing list