mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:55:39 +00:00
[UXTHEME_APITEST] -Add tests for SetThemeAppProperties.
svn path=/trunk/; revision=75513
This commit is contained in:
parent
effafa925c
commit
61427a2eaf
3 changed files with 87 additions and 0 deletions
|
@ -3,6 +3,7 @@ list(APPEND SOURCE
|
||||||
CloseThemeData.c
|
CloseThemeData.c
|
||||||
DrawThemeParentBackground.c
|
DrawThemeParentBackground.c
|
||||||
SetWindowTheme.c
|
SetWindowTheme.c
|
||||||
|
SetThemeAppProperties.c
|
||||||
../include/msgtrace.c
|
../include/msgtrace.c
|
||||||
testlist.c)
|
testlist.c)
|
||||||
|
|
||||||
|
|
84
rostests/apitests/uxtheme/SetThemeAppProperties.c
Normal file
84
rostests/apitests/uxtheme/SetThemeAppProperties.c
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS api tests
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* PURPOSE: Test for SetThemeAppProperties
|
||||||
|
* PROGRAMMERS: Giannis Adamopoulos
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <apitest.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <uxtheme.h>
|
||||||
|
#include <vfwmsgs.h>
|
||||||
|
|
||||||
|
START_TEST(SetThemeAppProperties)
|
||||||
|
{
|
||||||
|
BOOL bThemeActive;
|
||||||
|
HTHEME hTheme;
|
||||||
|
HWND hWnd;
|
||||||
|
|
||||||
|
bThemeActive = IsThemeActive();
|
||||||
|
if (!bThemeActive)
|
||||||
|
{
|
||||||
|
skip("No active theme, skipping SetWindowTheme tests\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
|
||||||
|
bThemeActive = IsAppThemed();
|
||||||
|
ok (bThemeActive == FALSE, "\n");
|
||||||
|
ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = OpenThemeData(NULL, L"BUTTON");
|
||||||
|
ok (hTheme == NULL, "\n");
|
||||||
|
ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
||||||
|
ok (hWnd != NULL, "\n");
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
bThemeActive = IsAppThemed();
|
||||||
|
ok (bThemeActive == TRUE, "\n");
|
||||||
|
ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = OpenThemeData(NULL, L"BUTTON");
|
||||||
|
ok (hTheme != NULL, "\n");
|
||||||
|
ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
SetThemeAppProperties(0);
|
||||||
|
ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
bThemeActive = IsThemeActive();
|
||||||
|
ok (bThemeActive == TRUE, "\n");
|
||||||
|
|
||||||
|
bThemeActive = IsAppThemed();
|
||||||
|
ok (bThemeActive == TRUE, "\n");
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = OpenThemeData(NULL, L"BUTTON");
|
||||||
|
ok (hTheme == NULL, "\n");
|
||||||
|
ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
SetThemeAppProperties(STAP_ALLOW_NONCLIENT);
|
||||||
|
|
||||||
|
hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT);
|
||||||
|
ok (hTheme != NULL, "\n");
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0);
|
||||||
|
ok (hTheme == NULL, "\n");
|
||||||
|
ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
|
||||||
|
|
||||||
|
SetThemeAppProperties(STAP_ALLOW_CONTROLS);
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT);
|
||||||
|
ok (hTheme == NULL, "\n");
|
||||||
|
ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
|
||||||
|
hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0);
|
||||||
|
ok (hTheme != NULL, "\n");
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
extern void func_CloseThemeData(void);
|
extern void func_CloseThemeData(void);
|
||||||
extern void func_DrawThemeParentBackground(void);
|
extern void func_DrawThemeParentBackground(void);
|
||||||
|
extern void func_SetThemeAppProperties(void);
|
||||||
extern void func_SetWindowTheme(void);
|
extern void func_SetWindowTheme(void);
|
||||||
|
|
||||||
const struct test winetest_testlist[] =
|
const struct test winetest_testlist[] =
|
||||||
|
@ -12,5 +13,6 @@ const struct test winetest_testlist[] =
|
||||||
{ "CloseThemeData", func_CloseThemeData },
|
{ "CloseThemeData", func_CloseThemeData },
|
||||||
{ "DrawThemeParentBackground", func_DrawThemeParentBackground },
|
{ "DrawThemeParentBackground", func_DrawThemeParentBackground },
|
||||||
{ "SetWindowTheme", func_SetWindowTheme },
|
{ "SetWindowTheme", func_SetWindowTheme },
|
||||||
|
{ "SetThemeAppProperties", func_SetThemeAppProperties },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue