user32/tests: Reorganize the DPI tests.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-05-02 17:32:29 +02:00
parent ca919ee9c4
commit 487599e77f

View File

@ -3325,11 +3325,24 @@ static void test_dpi_aware(void)
return;
}
if (pSetProcessDpiAwarenessContext)
ret = pSetProcessDPIAware();
ok(ret, "got %d\n", ret);
ret = pIsProcessDPIAware();
ok(ret, "got %d\n", ret);
dpi = real_dpi;
test_GetSystemMetrics();
test_metrics_for_dpi( 96 );
test_metrics_for_dpi( 192 );
}
static void test_dpi_context(void)
{
DPI_AWARENESS awareness;
DPI_AWARENESS_CONTEXT context;
ULONG_PTR i;
BOOL ret;
UINT dpi;
HDC hdc = GetDC( 0 );
@ -3498,23 +3511,8 @@ static void test_dpi_aware(void)
if (real_dpi != USER_DEFAULT_SCREEN_DPI) test_dpi_stock_objects( hdc );
ReleaseDC( 0, hdc );
}
else win_skip( "SetProcessDpiAwarenessContext not supported\n" );
ret = pSetProcessDPIAware();
ok(ret, "got %d\n", ret);
ret = pIsProcessDPIAware();
ok(ret, "got %d\n", ret);
if (pGetDpiForSystem) real_dpi = pGetDpiForSystem();
dpi = real_dpi;
test_GetSystemMetrics();
test_metrics_for_dpi( 96 );
test_metrics_for_dpi( 192 );
test_dpi_mapping();
}
static void test_window_dpi(void)
static void test_dpi_window(void)
{
DPI_AWARENESS_CONTEXT context, orig;
DPI_AWARENESS awareness;
@ -3649,6 +3647,13 @@ START_TEST(sysparams)
DispatchMessageA( &msg );
}
test_dpi_aware();
test_window_dpi();
if (pSetThreadDpiAwarenessContext)
{
test_dpi_context();
test_dpi_mapping();
test_dpi_window();
}
else win_skip( "SetThreadDpiAwarenessContext not supported\n" );
test_dpi_aware();
}