uxtheme/tests: Added test for IsAppThemed and grouped it with IsThemeActive.
This commit is contained in:
parent
98d4c2b049
commit
14b4e85148
@ -26,6 +26,7 @@
|
|||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
|
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
|
||||||
|
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);
|
||||||
static HRESULT (WINAPI * pSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
|
static HRESULT (WINAPI * pSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
|
||||||
@ -50,6 +51,7 @@ static BOOL InitFunctionPtrs(void)
|
|||||||
if (hUxtheme)
|
if (hUxtheme)
|
||||||
{
|
{
|
||||||
UXTHEME_GET_PROC(CloseThemeData)
|
UXTHEME_GET_PROC(CloseThemeData)
|
||||||
|
UXTHEME_GET_PROC(IsAppThemed)
|
||||||
UXTHEME_GET_PROC(IsThemeActive)
|
UXTHEME_GET_PROC(IsThemeActive)
|
||||||
UXTHEME_GET_PROC(OpenThemeData)
|
UXTHEME_GET_PROC(OpenThemeData)
|
||||||
UXTHEME_GET_PROC(SetWindowTheme)
|
UXTHEME_GET_PROC(SetWindowTheme)
|
||||||
@ -57,6 +59,36 @@ static BOOL InitFunctionPtrs(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_IsThemed(void)
|
||||||
|
{
|
||||||
|
BOOL bThemeActive;
|
||||||
|
BOOL bAppThemed;
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
bThemeActive = pIsThemeActive();
|
||||||
|
trace("Theming is %s\n", (bThemeActive) ? "active" : "inactive");
|
||||||
|
todo_wine
|
||||||
|
ok( GetLastError() == ERROR_SUCCESS,
|
||||||
|
"Expected ERROR_SUCCESS, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
|
/* This test is not themed */
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
bAppThemed = pIsAppThemed();
|
||||||
|
|
||||||
|
if (bThemeActive)
|
||||||
|
todo_wine
|
||||||
|
ok( bAppThemed == FALSE, "Expected FALSE as this test executable is not (yet) themed.\n");
|
||||||
|
else
|
||||||
|
/* Although Wine currently returns FALSE, the logic behind it is wrong. It is not a todo_wine though in the testing sense */
|
||||||
|
ok( bAppThemed == FALSE, "Expected FALSE as this test executable is not (yet) themed.\n");
|
||||||
|
|
||||||
|
todo_wine
|
||||||
|
ok( GetLastError() == ERROR_SUCCESS,
|
||||||
|
"Expected ERROR_SUCCESS, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
static void test_SetWindowTheme(void)
|
static void test_SetWindowTheme(void)
|
||||||
{
|
{
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
@ -88,10 +120,6 @@ static void test_OpenThemeData(void)
|
|||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bThemeActive = pIsThemeActive();
|
bThemeActive = pIsThemeActive();
|
||||||
todo_wine
|
|
||||||
ok( GetLastError() == ERROR_SUCCESS,
|
|
||||||
"Expected ERROR_SUCCESS, got 0x%08lx\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* All NULL */
|
/* All NULL */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
@ -204,6 +232,11 @@ START_TEST(system)
|
|||||||
* only show input/return behaviour
|
* only show input/return behaviour
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* IsThemeActive and IsAppThemed */
|
||||||
|
trace("Starting test_IsThemed()\n");
|
||||||
|
if (pIsAppThemed && pIsThemeActive)
|
||||||
|
test_IsThemed();
|
||||||
|
|
||||||
/* SetWindowTheme */
|
/* SetWindowTheme */
|
||||||
trace("Starting test_SetWindowTheme()\n");
|
trace("Starting test_SetWindowTheme()\n");
|
||||||
if (pSetWindowTheme)
|
if (pSetWindowTheme)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user