Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/comctl32/tests/resources.h | 5 +++ dlls/comctl32/tests/rsrc.rc | 17 +++++++++ dlls/comctl32/tests/taskdialog.c | 62 ++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+)
diff --git a/dlls/comctl32/tests/resources.h b/dlls/comctl32/tests/resources.h index 3a89cd7baf..0e4ff6702c 100644 --- a/dlls/comctl32/tests/resources.h +++ b/dlls/comctl32/tests/resources.h @@ -48,4 +48,9 @@ #define IDC_PS_COMBO1 1020 #define IDC_PS_PUSHBUTTON1 1021
+#define IDC_TASKDIALOG_CREATE 1030 +#define IDC_TASKDIALOG_TEXT_TITLE 1031 +#define IDC_TASKDIALOG_TEXT_MAIN 1032 +#define IDC_TASKDIALOG_TEXT_CONTENT 1033 + #endif /* __WINE_COMCTL32_TEST_RESOURCES_H */ diff --git a/dlls/comctl32/tests/rsrc.rc b/dlls/comctl32/tests/rsrc.rc index 959130e2f1..fad3f71858 100644 --- a/dlls/comctl32/tests/rsrc.rc +++ b/dlls/comctl32/tests/rsrc.rc @@ -173,3 +173,20 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Cancel", IDCANCEL, 100, 60, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP EDITTEXT 1000, 5, 5, 150, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_WANTRETURN } + +TAKDIALOG_CREATOR DIALOG 0, 0, 600, 500 +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_CENTER +CAPTION "Taskdialog Creator" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Title:", -1, 5, 5, 70, 15, BS_CENTER + EDITTEXT IDC_TASKDIALOG_TEXT_TITLE, 75, 5, 450, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_WANTRETURN + + LTEXT "Main Instruction:", -1, 5, 25, 70, 50, BS_CENTER + EDITTEXT IDC_TASKDIALOG_TEXT_MAIN, 75, 25, 450, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN + + LTEXT "Content:", -1, 5, 80, 70, 50, BS_CENTER + EDITTEXT IDC_TASKDIALOG_TEXT_CONTENT, 75, 80, 450, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN + + PUSHBUTTON "Create Taskdialog", IDC_TASKDIALOG_CREATE, 260, 460, 80, 30, WS_CHILD | WS_VISIBLE | WS_TABSTOP +} diff --git a/dlls/comctl32/tests/taskdialog.c b/dlls/comctl32/tests/taskdialog.c index 432b89bd15..3b78f4fbf7 100644 --- a/dlls/comctl32/tests/taskdialog.c +++ b/dlls/comctl32/tests/taskdialog.c @@ -28,6 +28,7 @@ #include "wine/test.h" #include "v6util.h" #include "msg.h" +#include "resources.h"
#define WM_TD_CALLBACK (WM_APP) /* Custom dummy message to wrap callback notifications */
@@ -374,6 +375,61 @@ static void test_timer(void) pTaskDialogIndirect(&info, NULL, NULL, NULL); }
+/* Caller must free the buffer */ +static WCHAR* control_get_text(HWND hdlg, int id_control) +{ + HWND hwnd_control = GetDlgItem(hdlg, id_control); + int text_length = GetWindowTextLengthW(hwnd_control); + WCHAR *text = heap_alloc((text_length + 1) * sizeof(WCHAR)); + GetWindowTextW(hwnd_control, text, text_length + 1); + return text; +} + +static void taskdialog_creator_create(HWND hdlg) +{ + TASKDIALOGCONFIG info = { 0 }; + WCHAR *text_title; + WCHAR *text_main_instruction; + WCHAR *text_content; + + text_title = control_get_text(hdlg, IDC_TASKDIALOG_TEXT_TITLE); + text_main_instruction = control_get_text(hdlg, IDC_TASKDIALOG_TEXT_MAIN); + text_content = control_get_text(hdlg, IDC_TASKDIALOG_TEXT_CONTENT); + + info.cbSize = sizeof(TASKDIALOGCONFIG); + info.hwndParent = hdlg; + info.pszWindowTitle = text_title; + info.pszMainInstruction = text_main_instruction; + info.pszContent = text_content; + + pTaskDialogIndirect(&info, NULL, NULL, NULL); + + heap_free(text_title); + heap_free(text_main_instruction); + heap_free(text_content); +} + +static INT_PTR CALLBACK taskdialog_creator_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_COMMAND: + if (HIWORD(wparam) == BN_CLICKED && LOWORD(wparam) == IDC_TASKDIALOG_CREATE) + { + taskdialog_creator_create(hdlg); + } + break; + case WM_CLOSE: + EndDialog(hdlg, 0); + break; + + default: + break; + } + + return FALSE; +} + START_TEST(taskdialog) { ULONG_PTR ctx_cookie; @@ -405,6 +461,12 @@ START_TEST(taskdialog) ok(pTaskDialogIndirect == ptr_ordinal, "got wrong pointer for ordinal 345, %p expected %p\n", ptr_ordinal, pTaskDialogIndirect);
+ if (winetest_interactive) + { + DialogBoxParamA(GetModuleHandleA(NULL), "TAKDIALOG_CREATOR", NULL, taskdialog_creator_proc, 0); + return; + } + init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
test_invalid_parameters();
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38878
Your paranoid android.
=== wvistau64_zh_CN (32 bit edit) === edit.c:1542: Test failed: 0: got 2, 1 edit.c:1563: Test failed: 0: got 2, 1 edit.c:1577: Test failed: 0: got 2, 1 edit.c:1591: Test failed: 0: got 2, 1 edit.c:1717: Test failed: got 1 edit.c:1718: Test failed: got 1 edit.c:1724: Test failed: got 1 edit.c:1740: Test failed: got 2 edit.c:1763: Test failed: got 1
=== wvistau64 (32 bit listbox) === listbox.c:939: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_zh_CN (32 bit listbox) === listbox.c:939: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_fr (32 bit listbox) === listbox.c:939: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_he (32 bit listbox) === listbox.c:939: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64 (64 bit listbox) === listbox.c:939: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== w864 (64 bit listbox) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w864 (32 bit misc) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w2003std (32 bit static) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w2008s64 (64 bit static) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w7u (32 bit taskdialog) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== wvistau64 (64 bit button) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
=== w8 (32 bit treeview) === TestBot process got stuck or died unexpectedly The previous 1 run(s) terminated abnormally
Probably unrelated, I don't know how my patch could have caused this.
Regards, Fabian Maurer
Personally I don't think this is useful, because it won't run automatically and detect any problems. If you want to see what it looks like or interact with it, it's trivial to make any taskdialog test not to close the dialog automatically.
Personally I don't think this is useful, because it won't run automatically and detect any problems.
I figured it'd be useful for interactive testing, I mean all interactive tests don't run automatically. And I don't see a better way for visual testing here.
If you want to see what it looks like or interact with it, it's trivial to make any taskdialog test not to close the dialog automatically.
That sounds hacky, I'd prefer real tests for that. Isn't that what interactvie tests are for? I mean sure, we could add a bunch of special tests that we then pause when we want to see what it looks like, but it's a lot easier to do visual checks with the creator I proposed - without having to edit any code.
Regards, Fabian Maurer