Module: wine Branch: master Commit: e2bc3bc40d52310e178e38bd2d26f66417454576 URL: https://gitlab.winehq.org/wine/wine/-/commit/e2bc3bc40d52310e178e38bd2d26f66...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Dec 16 15:30:01 2022 +0100
user32/tests: Don't expect WM_DISPLAYCHANGE with the default display mode.
It looks like the behavior changes when only this test is run vs when it is run as part of the winetest suite.
This is probably because ChangeDisplaySettingsExW only sends the message the first time it is called (since boot?).
Having other tests run before it, one of them probably changed display settings already and we're not getting the message anymore.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53894
---
dlls/user32/tests/sysparams.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index a53c43b391a..debe05c42a3 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -2463,16 +2463,19 @@ static void test_WM_DISPLAYCHANGE(void) ok( settings.dmBitsPerPel == 32, "got dmBitsPerPel %lu\n", settings.dmBitsPerPel ); default_bpp = settings.dmBitsPerPel;
- /* setting the default mode here sends a WM_DISPLAYCHANGE */ + /* setting default mode most of the time doesn't send WM_DISPLAYCHANGE, + * it only does the first time ChangeDisplaySettingsExW is called */
last_bpp = -1; change_counter = 0; displaychange_ok = TRUE; res = ChangeDisplaySettingsExW( NULL, &settings, NULL, 0, NULL ); ok( !res, "ChangeDisplaySettingsExW returned %ld\n", res ); - res = WaitForSingleObject( displaychange_sem, 10000 ); - ok( !res, "WaitForSingleObject returned %#lx\n", res ); - ok( last_bpp == default_bpp, "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); + res = WaitForSingleObject( displaychange_sem, 1000 ); + todo_wine + ok( res == WAIT_TIMEOUT || broken( !res ), "WaitForSingleObject returned %#lx\n", res ); + todo_wine + ok( last_bpp == -1 || broken( last_bpp == default_bpp ), "got WM_DISPLAYCHANGE bpp %u\n", last_bpp ); displaychange_ok = FALSE;
for (i = 0; i < ARRAY_SIZE(test_bpps); i++)