From eba9294d9e4806882ffda21c4a3ca526153649be Mon Sep 17 00:00:00 2001 From: Fabian Maurer Date: Mon, 13 Feb 2017 16:58:28 +0100 Subject: [PATCH] user32/tests: Add WM_NCPAINT tests for windows crossing screen or maximized. Signed-off-by: Fabian Maurer Signed-off-by: Alexandre Julliard --- dlls/user32/tests/msg.c | 86 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index d60b93ed695..1752b686bad 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -758,7 +758,7 @@ static const struct message WmCreateInvisibleMaxPopupSeq[] = { { 0 } }; /* ShowWindow(SW_SHOWMAXIMIZED) for a resized not visible popup window */ -static const struct message WmShowMaxPopupResizedSeq[] = { +static const struct message WmShowMaxPopupResizedSeq_todo[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE }, { WM_GETMINMAXINFO, sent }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED }, @@ -789,6 +789,37 @@ static const struct message WmShowMaxPopupResizedSeq[] = { { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; +static const struct message WmShowMaxPopupResizedSeq[] = { + { HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE }, + { WM_GETMINMAXINFO, sent }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED }, + { WM_NCCALCSIZE, sent|wparam, TRUE }, + { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, + { HCBT_ACTIVATE, hook }, + { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, + { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_NCPAINT, sent|wparam|optional, 1 }, + { WM_ERASEBKGND, sent|optional }, + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { WM_ACTIVATEAPP, sent|wparam, 1 }, + { WM_NCACTIVATE, sent }, + { WM_ACTIVATE, sent|wparam, 1 }, + { HCBT_SETFOCUS, hook }, + { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_GETTEXT, sent|optional }, + { WM_NCPAINT, sent|optional }, /* We'll check WM_NCPAINT behaviour in another test */ + { WM_ERASEBKGND, sent|optional }, + { WM_WINDOWPOSCHANGED, sent }, + /* WinNT4.0 sends WM_MOVE */ + { WM_MOVE, sent|defwinproc|optional }, + { WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED }, + { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, + { 0 } +}; /* ShowWindow(SW_SHOWMAXIMIZED) for a not visible popup window */ static const struct message WmShowMaxPopupSeq[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE }, @@ -927,6 +958,38 @@ static const struct message WmShowVisiblePopupSeq_3[] = { { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE, 0, SWP_SHOWWINDOW }, { 0 } }; +/* CreateWindow (for a popup window with WS_VISIBLE style set and extreme location) + */ +static const struct message WmShowPopupExtremeLocationSeq[] = { + { HCBT_CREATEWND, hook }, + { WM_NCCREATE, sent }, + { WM_NCCALCSIZE, sent|wparam, 0 }, + { WM_CREATE, sent }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 }, + { WM_SIZE, sent|wparam, SIZE_RESTORED }, + { WM_MOVE, sent }, + { WM_SHOWWINDOW, sent|wparam, 1 }, + { WM_WINDOWPOSCHANGING, sent }, + { HCBT_ACTIVATE, hook }, + { WM_WINDOWPOSCHANGING, sent|optional }, + { WM_QUERYNEWPALETTE, sent|optional }, + { WM_ACTIVATEAPP, sent }, + { WM_NCACTIVATE, sent }, + { WM_ACTIVATE, sent }, + { WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 }, + { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, + { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, + { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, + { HCBT_SETFOCUS, hook }, + { WM_SETFOCUS, sent|defwinproc }, + { WM_NCPAINT, sent|wparam, 1 }, + { WM_ERASEBKGND, sent }, + { WM_WINDOWPOSCHANGED, sent }, + /* ocasionally received on test machines */ + { WM_NCPAINT, sent|optional }, + { WM_ERASEBKGND, sent|optional }, + { 0 } +}; /* CreateWindow (for a popup window with WS_VISIBLE style set) */ static const struct message WmShowPopupFirstDrawSeq_1[] = { @@ -4580,6 +4643,18 @@ static void test_showwindow(void) DestroyWindow(hwnd); flush_sequence(); + /* Test again, this time the NC_PAINT message */ + hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_MAXIMIZE, + 100, 100, 200, 200, 0, 0, 0, NULL); + ok (hwnd != 0, "Failed to create popup window\n"); + SetWindowPos(hwnd, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE); + flush_sequence(); + ShowWindow(hwnd, SW_SHOWMAXIMIZED); + ok_sequence(WmShowMaxPopupResizedSeq_todo, + "ShowWindow(SW_SHOWMAXIMIZED):invisible maximized and resized popup TODO", FALSE); + DestroyWindow(hwnd); + flush_sequence(); + /* Test 2: * 1. Create invisible maximized popup window. * 2. Show it maximized. @@ -5149,6 +5224,15 @@ static void test_messages(void) DestroyWindow(hchild); DestroyWindow(hparent); + /* Test message sequence for extreme position and size */ + + flush_sequence(); + hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP | WS_VISIBLE, + -10, -10, 10000, 10000, NULL, 0, 0, NULL ); + ok (hwnd != 0, "Failed to create popup window\n"); + ok_sequence(WmShowPopupExtremeLocationSeq, "RedrawWindow:show_popup_extreme_location", TRUE); + DestroyWindow(hwnd); + /* Test child windows */