uxtheme/tests: Test SetWindowTheme() with a non-existent subclass.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 59f3758ecb
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
bc6346ba85
commit
e049b275c5
|
@ -102,6 +102,7 @@ static void test_GetWindowTheme(void)
|
||||||
|
|
||||||
static void test_SetWindowTheme(void)
|
static void test_SetWindowTheme(void)
|
||||||
{
|
{
|
||||||
|
HTHEME hTheme;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
|
|
||||||
|
@ -110,12 +111,30 @@ todo_wine
|
||||||
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
||||||
|
|
||||||
/* Only do the bare minimum to get a valid hwnd */
|
/* Only do the bare minimum to get a valid hwnd */
|
||||||
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
hWnd = CreateWindowExA(0, "button", "test", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
|
||||||
ok(hWnd != NULL, "Failed to create a test window.\n");
|
ok(hWnd != NULL, "Failed to create a test window.\n");
|
||||||
|
|
||||||
hRes = SetWindowTheme(hWnd, NULL, NULL);
|
hRes = SetWindowTheme(hWnd, NULL, NULL);
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
|
|
||||||
|
if (IsThemeActive())
|
||||||
|
{
|
||||||
|
hTheme = OpenThemeData(hWnd, L"Button");
|
||||||
|
ok(!!hTheme, "OpenThemeData failed.\n");
|
||||||
|
CloseThemeData(hTheme);
|
||||||
|
|
||||||
|
hRes = SetWindowTheme(hWnd, L"deadbeef", NULL);
|
||||||
|
ok(hRes == S_OK, "Expected S_OK, got 0x%08x.\n", hRes);
|
||||||
|
|
||||||
|
hTheme = OpenThemeData(hWnd, L"Button");
|
||||||
|
todo_wine ok(!!hTheme, "OpenThemeData failed.\n");
|
||||||
|
CloseThemeData(hTheme);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
skip("No active theme, skipping rest of SetWindowTheme tests.\n");
|
||||||
|
}
|
||||||
|
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue