From 8f8760a1a5af46315b69ed383f64df73d441128a Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sun, 11 Sep 2011 23:16:59 +0200 Subject: [PATCH] msctf/tests: Give time for the messages to arrive. --- dlls/msctf/tests/inputprocessor.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c index 3262c6bccbf..8f409c35c23 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(); } } -- 2.11.4.GIT