uxtheme/tests: Add some tests for GetWindowTheme.
This commit is contained in:
parent
b865c07db9
commit
36a775d0c7
|
@ -26,6 +26,7 @@
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
|
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
|
||||||
|
static HTHEME (WINAPI * pGetWindowTheme)(HWND);
|
||||||
static BOOL (WINAPI * pIsAppThemed)(VOID);
|
static BOOL (WINAPI * pIsAppThemed)(VOID);
|
||||||
static BOOL (WINAPI * pIsThemeActive)(VOID);
|
static BOOL (WINAPI * pIsThemeActive)(VOID);
|
||||||
static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR);
|
static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR);
|
||||||
|
@ -51,6 +52,7 @@ static BOOL InitFunctionPtrs(void)
|
||||||
if (hUxtheme)
|
if (hUxtheme)
|
||||||
{
|
{
|
||||||
UXTHEME_GET_PROC(CloseThemeData)
|
UXTHEME_GET_PROC(CloseThemeData)
|
||||||
|
UXTHEME_GET_PROC(GetWindowTheme)
|
||||||
UXTHEME_GET_PROC(IsAppThemed)
|
UXTHEME_GET_PROC(IsAppThemed)
|
||||||
UXTHEME_GET_PROC(IsThemeActive)
|
UXTHEME_GET_PROC(IsThemeActive)
|
||||||
UXTHEME_GET_PROC(OpenThemeData)
|
UXTHEME_GET_PROC(OpenThemeData)
|
||||||
|
@ -89,6 +91,31 @@ static void test_IsThemed(void)
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_GetWindowTheme(void)
|
||||||
|
{
|
||||||
|
HTHEME hTheme;
|
||||||
|
HWND hWnd;
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = pGetWindowTheme(NULL);
|
||||||
|
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
|
||||||
|
todo_wine
|
||||||
|
ok( GetLastError() == E_HANDLE,
|
||||||
|
"Expected E_HANDLE, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
|
/* Only do the bare minumum to get a valid hwnd */
|
||||||
|
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
||||||
|
if (!hWnd) return;
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = pGetWindowTheme(hWnd);
|
||||||
|
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
|
||||||
|
ok( GetLastError() == 0xdeadbeef,
|
||||||
|
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
static void test_SetWindowTheme(void)
|
static void test_SetWindowTheme(void)
|
||||||
{
|
{
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
@ -244,6 +271,11 @@ START_TEST(system)
|
||||||
if (pIsAppThemed && pIsThemeActive)
|
if (pIsAppThemed && pIsThemeActive)
|
||||||
test_IsThemed();
|
test_IsThemed();
|
||||||
|
|
||||||
|
/* GetWindowTheme */
|
||||||
|
trace("Starting test_GetWindowTheme()\n");
|
||||||
|
if (pGetWindowTheme)
|
||||||
|
test_GetWindowTheme();
|
||||||
|
|
||||||
/* SetWindowTheme */
|
/* SetWindowTheme */
|
||||||
trace("Starting test_SetWindowTheme()\n");
|
trace("Starting test_SetWindowTheme()\n");
|
||||||
if (pSetWindowTheme)
|
if (pSetWindowTheme)
|
||||||
|
|
Loading…
Reference in New Issue