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

This commit is contained in:
Francois Gouget 2011-09-11 23:16:59 +02:00 committed by Alexandre Julliard
parent 6ab1d31f04
commit 8f8760a1a5
1 changed files with 14 additions and 3 deletions

View File

@ -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();
}
}