Module: wine Branch: master Commit: 8f8760a1a5af46315b69ed383f64df73d441128a URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f8760a1a5af46315b69ed383f...
Author: Francois Gouget fgouget@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(); } }