Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ab091b28
Commit
ab091b28
authored
Apr 18, 2024
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Apr 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme/tests: Test that scrollbar parts should have very few #ffffff pixels.
parent
fbfc8df4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
system.c
dlls/uxtheme/tests/system.c
+34
-2
No files found.
dlls/uxtheme/tests/system.c
View file @
ab091b28
...
@@ -2633,12 +2633,15 @@ static void test_GetThemeBackgroundRegion(void)
...
@@ -2633,12 +2633,15 @@ static void test_GetThemeBackgroundRegion(void)
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
}
}
static
void
test_theme
(
void
)
static
void
test_theme
(
BOOL
v6
)
{
{
static
const
int
scrollbar_width
=
200
,
scrollbar_height
=
50
;
int
x
,
y
,
white_count
=
0
,
white_percent
;
BOOL
transparent
;
BOOL
transparent
;
HTHEME
htheme
;
HTHEME
htheme
;
HRESULT
hr
;
HRESULT
hr
;
HWND
hwnd
;
HWND
hwnd
;
HDC
hdc
;
if
(
!
IsThemeActive
())
if
(
!
IsThemeActive
())
{
{
...
@@ -2675,6 +2678,34 @@ static void test_theme(void)
...
@@ -2675,6 +2678,34 @@ static void test_theme(void)
CloseThemeData
(
htheme
);
CloseThemeData
(
htheme
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
/* Test that scrollbar parts should have very few #ffffff pixels */
hwnd
=
CreateWindowA
(
WC_SCROLLBARA
,
"scrollbar"
,
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
scrollbar_width
,
scrollbar_height
,
0
,
0
,
0
,
NULL
);
ok
(
!!
hwnd
,
"CreateWindowA failed, error %#lx.
\n
"
,
GetLastError
());
flush_events
();
hdc
=
GetDC
(
hwnd
);
for
(
y
=
0
;
y
<
scrollbar_height
;
y
++
)
{
for
(
x
=
0
;
x
<
scrollbar_width
;
x
++
)
{
COLORREF
color
=
GetPixel
(
hdc
,
x
,
y
);
ok
(
color
!=
CLR_INVALID
,
"GetPixel failed.
\n
"
);
if
(
color
==
0xffffff
)
white_count
++
;
}
}
white_percent
=
white_count
*
100
/
(
scrollbar_width
*
scrollbar_height
);
if
(
v6
)
todo_wine
ok
(
white_percent
<
4
,
"Expected #ffffff pixels less than 4%%.
\n
"
);
else
ok
(
white_percent
<
50
,
"Expected #ffffff pixels less than 50%%.
\n
"
);
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
}
static
void
test_ShouldSystemUseDarkMode
(
void
)
static
void
test_ShouldSystemUseDarkMode
(
void
)
...
@@ -2760,13 +2791,14 @@ START_TEST(system)
...
@@ -2760,13 +2791,14 @@ START_TEST(system)
test_DrawThemeParentBackground
();
test_DrawThemeParentBackground
();
test_DrawThemeBackgroundEx
();
test_DrawThemeBackgroundEx
();
test_GetThemeBackgroundRegion
();
test_GetThemeBackgroundRegion
();
test_theme
();
test_theme
(
FALSE
);
test_ShouldSystemUseDarkMode
();
test_ShouldSystemUseDarkMode
();
test_ShouldAppsUseDarkMode
();
test_ShouldAppsUseDarkMode
();
if
(
load_v6_module
(
&
ctx_cookie
,
&
ctx
))
if
(
load_v6_module
(
&
ctx_cookie
,
&
ctx
))
{
{
test_EnableThemeDialogTexture
();
test_EnableThemeDialogTexture
();
test_theme
(
TRUE
);
unload_v6_module
(
ctx_cookie
,
ctx
);
unload_v6_module
(
ctx_cookie
,
ctx
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment