user32/tests: Flush events more aggressively in mouse input test.

This commit is contained in:
Alexandre Julliard 2007-07-25 13:46:42 +02:00
parent cb0a626e50
commit 809d47839d
1 changed files with 4 additions and 6 deletions

View File

@ -2507,7 +2507,7 @@ static void test_mouse_input(HWND hwnd)
GetCursorPos(&pt);
ok(x == pt.x && y == pt.y, "wrong cursor pos (%d,%d), expected (%d,%d)\n", pt.x, pt.y, x, y);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
flush_events();
/* Check that setting the same position will generate WM_MOUSEMOVE */
SetCursorPos(x, y);
@ -2520,7 +2520,7 @@ static void test_mouse_input(HWND hwnd)
* otherwise it won't generate relative mouse movements below.
*/
mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
flush_events();
msg.message = 0;
mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
@ -2536,7 +2536,7 @@ static void test_mouse_input(HWND hwnd)
ShowWindow(popup, SW_HIDE);
ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "no message available\n");
ok(msg.hwnd == hwnd && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
flush_events();
mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
ShowWindow(hwnd, SW_HIDE);
@ -2547,8 +2547,6 @@ static void test_mouse_input(HWND hwnd)
ShowWindow(hwnd, SW_SHOW);
ShowWindow(popup, SW_SHOW);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
flush_events();
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
@ -2580,7 +2578,7 @@ static void test_mouse_input(HWND hwnd)
ok(!ret, "message %04x available\n", msg.message);
ShowWindow(popup, SW_HIDE);
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
flush_events();
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);