Piotr Caban : user32/tests: Add more dialog creation message tests.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 18 10:14:56 CST 2016


Module: wine
Branch: master
Commit: e7aabc640daff9ec3139e3a755b969a013335411
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e7aabc640daff9ec3139e3a755b969a013335411

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Feb 16 14:49:23 2016 +0100

user32/tests: Add more dialog creation message tests.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/msg.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index d15a8e7..1ef7841 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -11901,6 +11901,47 @@ static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPAR
     return 1;
 }
 
+static WNDPROC orig_edit_proc;
+static LRESULT WINAPI dlg_creation_edit_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
+{
+    struct recvd_message msg;
+
+    if (ignore_message( message )) return 0;
+
+    msg.hwnd = hwnd;
+    msg.message = message;
+    msg.flags = sent|wparam|lparam;
+    msg.wParam = wp;
+    msg.lParam = lp;
+    msg.descr = "edit";
+    add_message(&msg);
+
+    return CallWindowProcW(orig_edit_proc, hwnd, message, wp, lp);
+}
+
+static INT_PTR WINAPI test_dlg_proc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    struct recvd_message msg;
+
+    if (ignore_message( message )) return 0;
+
+    msg.hwnd = hwnd;
+    msg.message = message;
+    msg.flags = sent|wparam|lparam|parent;
+    msg.wParam = wParam;
+    msg.lParam = lParam;
+    msg.descr = "dialog";
+    add_message(&msg);
+
+    if (message == WM_INITDIALOG)
+    {
+        orig_edit_proc = (WNDPROC)SetWindowLongPtrW(GetDlgItem(hwnd, 200),
+                GWLP_WNDPROC, (LONG_PTR)dlg_creation_edit_proc);
+    }
+
+    return 1;
+}
+
 static const struct message WmDefDlgSetFocus_1[] = {
     { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
     { WM_GETTEXTLENGTH, sent|wparam|lparam|optional, 0, 0 }, /* XP */
@@ -11959,6 +12000,30 @@ static const struct message WmCreateDialogParamSeq_2[] = {
     { 0 }
 };
 
+static const struct message WmCreateDialogParamSeq_3[] = {
+    { HCBT_CREATEWND, hook },
+    { WM_SETFONT, sent|parent },
+    { WM_INITDIALOG, sent|parent },
+    { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
+    { EM_SETSEL, sent|wparam|lparam, 0, INT_MAX },
+    { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
+    { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
+    { EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
+    { HCBT_ACTIVATE, hook },
+    { WM_QUERYNEWPALETTE, sent|parent|optional }, /* TODO: this message should not be sent */
+    { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
+    { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
+    { WM_ACTIVATEAPP, sent|parent|wparam, 1 },
+    { WM_NCACTIVATE, sent|parent },
+    { WM_ACTIVATE, sent|parent|wparam, 1 },
+    { WM_SETFOCUS, sent },
+    { WM_COMMAND, sent|parent|wparam, MAKELONG(200, EN_SETFOCUS) },
+    { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
+    { WM_USER, sent|parent },
+    { WM_CHANGEUISTATE, sent|parent|optional },
+    { 0 }
+};
+
 static void test_dialog_messages(void)
 {
     WNDCLASSA cls;
@@ -12061,6 +12126,13 @@ static void test_dialog_messages(void)
     DestroyWindow(hdlg);
     flush_sequence();
 
+    hdlg = CreateDialogParamA(0, "FOCUS_TEST_DIALOG_3", 0, test_dlg_proc2, 0);
+    ok(IsWindow(hdlg), "CreateDialogParam failed\n");
+    ok_sequence(WmCreateDialogParamSeq_3, "CreateDialogParam_3", TRUE);
+    EndDialog(hdlg, 0);
+    DestroyWindow(hdlg);
+    flush_sequence();
+
     UnregisterClassA(cls.lpszClassName, cls.hInstance);
 }
 




More information about the wine-cvs mailing list