From: Alexandros Frantzis alexandros.frantzis@collabora.com
In some Win10 testbot images (notably jp and cn), we can get a spurious layout change after creating the test window. Detect this and skip the tests since the test expectations (e.g., wchar mappings) are now invalid. --- dlls/user32/tests/input.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 81af2aa5f28..3b337b00687 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -714,7 +714,7 @@ static void get_test_scan( WORD vkey, WORD *scan, WCHAR *wch, WCHAR *wch_shift ) } }
-static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, WCHAR wch_shift, WCHAR wch_control ) +static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, WCHAR wch_shift, WCHAR wch_control, HKL hkl ) { #define WIN_MSG(m, w, l, ...) {.func = MSG_TEST_WIN, .message = {.msg = m, .wparam = w, .lparam = l}, ## __VA_ARGS__} #define KBD_HOOK(m, s, v, f, ...) {.func = LL_HOOK_KEYBD, .ll_hook_kbd = {.msg = m, .scan = s, .vkey = v, .flags = f}, ## __VA_ARGS__} @@ -1163,6 +1163,13 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W ok_ne( NULL, hwnd, HWND, "%p" ); wait_messages( 100, FALSE );
+ if (GetKeyboardLayout( 0 ) != hkl) + { + win_skip( "Spurious keyboard layout changed detected (expected: %p got: %p)\n", + hkl, GetKeyboardLayout( 0 ) ); + return; + } + hook = SetWindowsHookExW( WH_KEYBOARD_LL, ll_hook_kbd_proc, GetModuleHandleW( NULL ), 0 ); ok_ne( NULL, hook, HHOOK, "%p" );
@@ -4918,7 +4925,7 @@ static void test_UnregisterDeviceNotification(void) ok(ret == FALSE, "Unregistering NULL Device Notification returned: %d\n", ret); }
-static void test_SendInput( WORD vkey, WCHAR wch ) +static void test_SendInput( WORD vkey, WCHAR wch, HKL hkl ) { const struct user_call broken_sequence[] = { @@ -4936,6 +4943,13 @@ static void test_SendInput( WORD vkey, WCHAR wch ) ok_ne( NULL, hwnd, HWND, "%p" ); wait_messages( 100, FALSE );
+ if (GetKeyboardLayout( 0 ) != hkl) + { + win_skip( "Spurious keyboard layout changed detected (expected: %p got: %p)\n", + hkl, GetKeyboardLayout( 0 ) ); + return; + } + SetLastError( 0xdeadbeef ); ok_ret( 0, SendInput( 0, NULL, 0 ) ); ok_ret( ERROR_INVALID_PARAMETER, GetLastError() ); @@ -5758,8 +5772,8 @@ static void test_input_desktop( char **argv ) test_SetCursorPos();
get_test_scan( 'F', &scan, &wch, &wch_shift ); - test_SendInput( 'F', wch ); - test_SendInput_keyboard_messages( 'F', scan, wch, wch_shift, '\x06' ); + test_SendInput( 'F', wch, hkl ); + test_SendInput_keyboard_messages( 'F', scan, wch, wch_shift, '\x06', hkl ); test_SendInput_mouse_messages();
test_keyboard_ll_hook_blocking();