Commit d6a17d2c authored by Alexandre Julliard's avatar Alexandre Julliard

user32/tests: Make the initial timeout longer in flush_events() for machines…

user32/tests: Make the initial timeout longer in flush_events() for machines with slower round-trip times.
parent de928a09
...@@ -45,13 +45,15 @@ static void flush_events(void) ...@@ -45,13 +45,15 @@ static void flush_events(void)
{ {
MSG msg; MSG msg;
int diff = default_timeout; int diff = default_timeout;
int min_timeout = 50;
DWORD time = GetTickCount() + diff; DWORD time = GetTickCount() + diff;
while (diff > 0) while (diff > 0)
{ {
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break; if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount(); diff = time - GetTickCount();
min_timeout = 10;
} }
} }
......
...@@ -1543,14 +1543,16 @@ static void add_message(const struct message *msg) ...@@ -1543,14 +1543,16 @@ static void add_message(const struct message *msg)
static void flush_events(void) static void flush_events(void)
{ {
MSG msg; MSG msg;
int diff = 100; int diff = 200;
int min_timeout = 50;
DWORD time = GetTickCount() + diff; DWORD time = GetTickCount() + diff;
while (diff > 0) while (diff > 0)
{ {
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break; if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount(); diff = time - GetTickCount();
min_timeout = 10;
} }
} }
......
...@@ -63,13 +63,15 @@ static void flush_events(void) ...@@ -63,13 +63,15 @@ static void flush_events(void)
{ {
MSG msg; MSG msg;
int diff = 200; int diff = 200;
int min_timeout = 50;
DWORD time = GetTickCount() + diff; DWORD time = GetTickCount() + diff;
while (diff > 0) while (diff > 0)
{ {
if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break; if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
diff = time - GetTickCount(); diff = time - GetTickCount();
min_timeout = 10;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment