Commit 4dcc7a5a authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

shell32/tests: Wait for window to close in check_window_exists.

This fixes a race condition where the directory is deleted before the window closes, which causes an error dialog to appear. Cutting the number of iterations per wait loop in half is necessary so that doubling the number of wait loops does not result in a timeout when new tests are added. Signed-off-by: 's avatarAlex Henrie <alexhenrie24@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3cbccd44
......@@ -164,7 +164,7 @@ static BOOL check_window_exists(const char *name)
else
strcpy(title, name);
for (i = 0; i < 20; i++)
for (i = 0; i < 10; i++)
{
Sleep(100 * i);
if ((window = FindWindowA("ExplorerWClass", title)) ||
......@@ -175,7 +175,17 @@ static BOOL check_window_exists(const char *name)
}
}
return (window != NULL);
if (!window)
return FALSE;
for (i = 0; i < 10; i++)
{
Sleep(100 * i);
if (!IsWindow(window))
break;
}
return TRUE;
}
static BOOL check_exists(const char *name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment