I expect this is going to be tricky to get in. I ran into the following issues:
* test_ShowWindow behaves very strangely on Windows. It seems this isn't typical behavior, and is caused by an interaction with test_SetFocus, but I'm not sure exactly what it does to the thread state that causes this.
* Many of the SetWindowPos flag combinations tested don't actually show the window on Windows, therefore they don't send EVENT_SYSTEM_FOREGROUND. I was able to reproduce this with a stand-alone test, so it seems to be normal behavior.
* Windows can show a window without activating it, and Wine on X11 can't do that reliably for managed windows.
* There are a couple of cases where Windows sends an event and Wine doesn't. I figure it's OK to not cover every case, but I can go back and investigate those if needed.
This interacts with https://gitlab.winehq.org/wine/wine/-/merge_requests/2314, in that the tests don't really test much without it. I applied that MR for my own testing.
--
v2: win32u: Implement EVENT_SYSTEM_FOREGROUND.
user32: Run tests that notice focus changes early.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2853
Supersedes !3329.
--
v3: server: Cancel pipe asyncs when the last handle in process is closed.
server: Cancel socket asyncs when the last handle in process is closed.
ws2_32/tests: Add test for async cancel on socket's last process handle close.
ntdll/tests: Add test for async cancel on pipe's last process handle close.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3339
Knowing the content of the edit field is more useful than knowing the
strcmp() result. The text field may contain carriage returns and
linefeeds so use wine_dbgstr_a() so they are clearly visible in the
failure message.
Also prefix the ok messages with a unique string to indicate which
test_WM_PASTE() test failed.
---
The old failure messages all look the same so one has to refer to the
line number to know which test actually failed which is pretty tiresome.
Thisis even more so when checking old reports on test.winehq.org or
TestBot job results. It also prevents the TestBot from correctly
identifying failure modes (i.e. all test_WM_PASTE() failures looked the
same to it).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3356
Windows only provides the 32-bit API and using todo_wine win_skip() in
the 64-bit case would imply Wine needs fixing. So it's simpler to use
a plain skip().
Other schemes like picking between skip() and win_skip() based on bitness feel like they would be way overkill.
--
v2: msvcrt/tests: Check that some functions are only available in 32-bit code.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2811