=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: shell32/tests: Test WM_SETTEXT with AutoComplete.

Alexandre Julliard julliard at winehq.org
Wed Nov 14 16:18:59 CST 2018


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Tue Nov 13 13:04:06 2018 +0200

shell32/tests: Test WM_SETTEXT with AutoComplete.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/tests/autocomplete.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c
index 6921202..ad7eb6a 100644
--- a/dlls/shell32/tests/autocomplete.c
+++ b/dlls/shell32/tests/autocomplete.c
@@ -510,12 +510,14 @@ static void test_custom_source(void)
     static WCHAR str_alpha2[] = {'t','e','s','t','2',0};
     static WCHAR str_beta[] = {'a','u','t','o',' ','c','o','m','p','l','e','t','e',0};
     static WCHAR str_au[] = {'a','u',0};
+    static WCHAR str_aut[] = {'a','u','t',0};
     static WCHAR *suggestions[] = { str_alpha, str_alpha2, str_beta };
     struct string_enumerator *obj;
     IUnknown *enumerator;
     IAutoComplete2 *autocomplete;
     IAutoCompleteDropDown *acdropdown;
     HWND hwnd_edit;
+    DWORD flags = 0;
     WCHAR buffer[20];
     HRESULT hr;
 
@@ -587,6 +589,22 @@ static void test_custom_source(void)
     ok(obj->num_resets == 2, "Expected 2 resets, got %u\n", obj->num_resets);
     /* end of hijacks */
 
+    hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
+    ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
+    ok(flags & ACDD_VISIBLE, "AutoComplete DropDown should be visible\n");
+    SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_au);
+    dispatch_messages();
+    hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
+    ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
+    ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should have been hidden\n");
+    SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_aut);
+    dispatch_messages();
+    hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL);
+    ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr);
+    ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should be hidden\n");
+    SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer);
+    ok(lstrcmpW(str_aut, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_aut), wine_dbgstr_w(buffer));
+
     test_aclist_expand(hwnd_edit, enumerator);
     obj->num_resets = 0;
 




More information about the wine-cvs mailing list