msctf/tests: Give time for the messages to arrive.
This commit is contained in:
parent
6ab1d31f04
commit
8f8760a1a5
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue