uxtheme/tests: Added a bit more functional tests to OpenThemeData.
This commit is contained in:
parent
7dcfbdecd6
commit
5ca8bbd20c
|
@ -166,9 +166,10 @@ static void test_SetWindowTheme(void)
|
||||||
|
|
||||||
static void test_OpenThemeData(void)
|
static void test_OpenThemeData(void)
|
||||||
{
|
{
|
||||||
HTHEME hTheme;
|
HTHEME hTheme, hTheme2;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
BOOL bThemeActive;
|
BOOL bThemeActive;
|
||||||
|
HRESULT hRes;
|
||||||
BOOL bDestroyed;
|
BOOL bDestroyed;
|
||||||
|
|
||||||
WCHAR szInvalidClassList[] = {'D','E','A','D','B','E','E','F', 0 };
|
WCHAR szInvalidClassList[] = {'D','E','A','D','B','E','E','F', 0 };
|
||||||
|
@ -275,6 +276,40 @@ static void test_OpenThemeData(void)
|
||||||
"Expected ERROR_SUCCESS, got 0x%08lx\n",
|
"Expected ERROR_SUCCESS, got 0x%08lx\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
|
|
||||||
|
/* GetWindowTheme should return the last handle opened by OpenThemeData */
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme2 = pGetWindowTheme(hWnd);
|
||||||
|
ok( hTheme == hTheme2, "Expected the same HTHEME handle (%p<->%p)\n",
|
||||||
|
hTheme, hTheme2);
|
||||||
|
ok( GetLastError() == 0xdeadbeef,
|
||||||
|
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hRes = pCloseThemeData(hTheme);
|
||||||
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08lx\n", hRes);
|
||||||
|
ok( GetLastError() == 0xdeadbeef,
|
||||||
|
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
|
/* Close a second time */
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hRes = pCloseThemeData(hTheme);
|
||||||
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08lx\n", hRes);
|
||||||
|
ok( GetLastError() == 0xdeadbeef,
|
||||||
|
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
|
/* See if closing makes a difference for GetWindowTheme */
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme2 = NULL;
|
||||||
|
hTheme2 = pGetWindowTheme(hWnd);
|
||||||
|
ok( hTheme == hTheme2, "Expected the same HTHEME handle (%p<->%p)\n",
|
||||||
|
hTheme, hTheme2);
|
||||||
|
ok( GetLastError() == 0xdeadbeef,
|
||||||
|
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||||
|
GetLastError());
|
||||||
|
|
||||||
bDestroyed = DestroyWindow(hWnd);
|
bDestroyed = DestroyWindow(hWnd);
|
||||||
if (!bDestroyed)
|
if (!bDestroyed)
|
||||||
trace("Window %p couldn't be destroyed : 0x%08lx\n",
|
trace("Window %p couldn't be destroyed : 0x%08lx\n",
|
||||||
|
@ -314,7 +349,7 @@ START_TEST(system)
|
||||||
trace("Starting test_SetWindowTheme()\n");
|
trace("Starting test_SetWindowTheme()\n");
|
||||||
test_SetWindowTheme();
|
test_SetWindowTheme();
|
||||||
|
|
||||||
/* OpenThemeData */
|
/* OpenThemeData, a bit more functional now */
|
||||||
trace("Starting test_OpenThemeData()\n");
|
trace("Starting test_OpenThemeData()\n");
|
||||||
test_OpenThemeData();
|
test_OpenThemeData();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue