Module: wine Branch: master Commit: 716e9c93e4a2a0574e0028d428eb087574d8d843 URL: http://source.winehq.org/git/wine.git/?a=commit;h=716e9c93e4a2a0574e0028d428...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Fri Sep 2 21:55:37 2016 +0900
imm32/tests: Add more default IME window tests with message-only window.
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/imm32/tests/imm32.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index bed42a0..8e45efb 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -1024,6 +1024,41 @@ static DWORD WINAPI test_default_ime_disabled_cb(void *arg) return 1; }
+static DWORD WINAPI test_default_ime_with_message_only_window_cb(void *arg) +{ + HWND hwnd1, hwnd2, default_ime_wnd; + + test_phase = PHASE_UNKNOWN; + hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, + 240, 120, HWND_MESSAGE, NULL, GetModuleHandleW(NULL), NULL); + default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1); + ok(!IsWindow(default_ime_wnd), "Expected no IME windows, got %p\n", default_ime_wnd); + + hwnd2 = CreateWindowA(wndcls, "Wine imm32.dll test", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, + 240, 120, hwnd1, NULL, GetModuleHandleW(NULL), NULL); + default_ime_wnd = ImmGetDefaultIMEWnd(hwnd2); + ok(IsWindow(default_ime_wnd), "Expected IME window existance\n"); + + DestroyWindow(hwnd2); + DestroyWindow(hwnd1); + + hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, + 240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL); + default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1); + ok(IsWindow(default_ime_wnd), "Expected IME window existence\n"); + SetParent(hwnd1, HWND_MESSAGE); + default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1); + ok(IsWindow(default_ime_wnd), "Expected IME window existence\n"); + DestroyWindow(hwnd1); + return 1; +} + static void test_default_ime_window_creation(void) { HANDLE thread; @@ -1064,6 +1099,10 @@ static void test_default_ime_window_creation(void) WaitForSingleObject(thread, INFINITE); CloseHandle(thread);
+ thread = CreateThread(NULL, 0, test_default_ime_with_message_only_window_cb, NULL, 0, NULL); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + test_phase = PHASE_UNKNOWN; }