[v3 3/6] user32: Add tests for windows when first shown if they have children
Fabian Maurer
dark.shadow4 at web.de
Thu Feb 2 14:16:07 CST 2017
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
dlls/user32/tests/msg.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f32341ca71..5358d34304 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -1120,6 +1120,14 @@ static const struct message WmShowPopupFirstDrawSeq_ShowWindow5[] = {
{ WM_WINDOWPOSCHANGED, sent },
{ 0 }
};
+static const struct message WmShowPopupFirstDrawSeq_Child1[] = {
+ { 0 }
+};
+static const struct message WmShowPopupFirstDrawSeq_Child2[] = {
+ { WM_NCPAINT, sent|wparam, 1 },
+ { WM_ERASEBKGND, sent },
+ { 0 }
+};
/* CreateWindow (for child window, not initially visible) */
static const struct message WmCreateChildSeq[] = {
{ HCBT_CREATEWND, hook },
@@ -5103,6 +5111,38 @@ static void test_messages(void)
test_message_setpos(WmShowPopupFirstDrawSeq_ShowWindow2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOSIZE);
test_message_setpos(WmShowPopupFirstDrawSeq_ShowWindow2, SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOZORDER);
+ /* Test SetWindowPos with child windows */
+ flush_events();
+ hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ 100, 100, 200, 200, 0, 0, 0, NULL);
+ ok (hparent != 0, "Failed to create parent window\n");
+
+ hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
+ 0, 0, 10, 10, hparent, 0, 0, NULL);
+ ok (hchild != 0, "Failed to create child window\n");
+ flush_sequence();
+ SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW);
+ ok_sequence(WmShowPopupFirstDrawSeq_Child1, /* Expect no messages for the child */
+ "SetWindowPos:show_popup_first_show_window_child1", FALSE);
+ DestroyWindow(hchild);
+ DestroyWindow(hparent);
+
+ flush_events();
+ hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN,
+ 100, 100, 200, 200, 0, 0, 0, NULL);
+ ok (hparent != 0, "Failed to create parent window\n");
+
+ hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
+ 0, 0, 10, 10, hparent, 0, 0, NULL);
+ ok (hchild != 0, "Failed to create child window\n");
+ flush_sequence();
+ SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW);
+ ok_sequence(WmShowPopupFirstDrawSeq_Child2, /* Expect child to be redrawn */
+ "SetWindowPos:show_popup_first_show_window_child2", FALSE);
+ DestroyWindow(hchild);
+ DestroyWindow(hparent);
+
+
/* Test child windows */
hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
--
2.11.0
More information about the wine-patches
mailing list