Module: wine Branch: oldstable Commit: e83b7ecf8bf63594059942becbed0d33a95a005f URL: https://gitlab.winehq.org/wine/wine/-/commit/e83b7ecf8bf63594059942becbed0d3...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Fri Aug 12 11:32:54 2022 +0800
comctl32/tests: Test that changing focus for edit controls doesn't repaint immediately.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com (cherry picked from commit 2a27ffe423c3e8ccaafe3452ea76be2cfd25fdbb) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/comctl32/tests/edit.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c index e3b2f408047..92677d5db1b 100644 --- a/dlls/comctl32/tests/edit.c +++ b/dlls/comctl32/tests/edit.c @@ -3322,6 +3322,22 @@ static const struct message killfocus_combined_seq[] = { 0 } };
+static const struct message setfocus_sent_only_combined_seq[] = +{ + { WM_KILLFOCUS, sent|id, 0, 0, PARENT_ID }, + { WM_SETFOCUS, sent|id, 0, 0, EDIT_ID }, + { WM_COMMAND, sent|wparam|id, MAKEWPARAM(1, EN_SETFOCUS), 0, PARENT_ID }, + { 0 } +}; + +static const struct message killfocus_sent_only_combined_seq[] = +{ + { WM_KILLFOCUS, sent|id, 0, 0, EDIT_ID }, + { WM_COMMAND, sent|wparam|id, MAKEWPARAM(1, EN_KILLFOCUS), 0, PARENT_ID }, + { WM_SETFOCUS, sent|id, 0, 0, PARENT_ID }, + { 0 } +}; + static void test_cue_banner(void) { HWND hwnd_edit; @@ -3433,6 +3449,18 @@ static void test_change_focus(void) while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", TRUE);
+ /* Test message sequences without waiting for posted messages */ + SetFocus(parent_wnd); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + SetFocus(hwnd); + ok_sequence(sequences, COMBINED_SEQ_INDEX, setfocus_sent_only_combined_seq, + "Set focus sent only", TRUE); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + SetFocus(parent_wnd); + ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_sent_only_combined_seq, + "Kill focus sent only", TRUE); + SetCursorPos(orig_pos.x, orig_pos.y);
DestroyWindow(hwnd);