Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1ab87100
Commit
1ab87100
authored
Apr 23, 2021
by
Ziqing Hui
Committed by
Alexandre Julliard
Apr 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for maximizing and restoring windows without WS_CAPTION.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
60c7823d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
win.c
dlls/user32/tests/win.c
+59
-0
No files found.
dlls/user32/tests/win.c
View file @
1ab87100
...
@@ -6649,6 +6649,21 @@ static void test_ShowWindow(void)
...
@@ -6649,6 +6649,21 @@ static void test_ShowWindow(void)
RECT
rcMain
,
rc
,
rcMinimized
,
rcClient
,
rcEmpty
,
rcMaximized
,
rcResized
,
rcNonClient
;
RECT
rcMain
,
rc
,
rcMinimized
,
rcClient
,
rcEmpty
,
rcMaximized
,
rcResized
,
rcNonClient
;
LPARAM
ret
;
LPARAM
ret
;
MONITORINFO
mon_info
;
MONITORINFO
mon_info
;
unsigned
int
i
;
DWORD
test_style
[]
=
{
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
|
WS_THICKFRAME
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_THICKFRAME
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MAXIMIZEBOX
|
WS_THICKFRAME
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MINIMIZEBOX
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_MAXIMIZEBOX
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
|
WS_THICKFRAME
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_SYSMENU
,
WS_OVERLAPPED
|
WS_VISIBLE
|
WS_THICKFRAME
,
WS_OVERLAPPED
|
WS_VISIBLE
};
SetRect
(
&
rcClient
,
0
,
0
,
90
,
90
);
SetRect
(
&
rcClient
,
0
,
0
,
90
,
90
);
rcMain
=
rcClient
;
rcMain
=
rcClient
;
...
@@ -6905,6 +6920,50 @@ static void test_ShowWindow(void)
...
@@ -6905,6 +6920,50 @@ static void test_ShowWindow(void)
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
flush_events
(
TRUE
);
flush_events
(
TRUE
);
/* test maximize and restore windows without setting WS_CAPTION */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
test_style
);
++
i
)
{
SetRect
(
&
rcMain
,
0
,
0
,
90
,
90
);
OffsetRect
(
&
rcMain
,
120
,
120
);
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
NULL
,
test_style
[
i
],
rcMain
.
left
,
rcMain
.
top
,
rcMain
.
right
-
rcMain
.
left
,
rcMain
.
bottom
-
rcMain
.
top
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
NULL
,
"Test %u: failed to create window with error %u
\n
"
,
i
,
GetLastError
());
GetWindowRect
(
hwnd
,
&
rcMain
);
ok
(
rcMain
.
left
>
mon_info
.
rcMonitor
.
left
&&
rcMain
.
right
<
mon_info
.
rcMonitor
.
right
&&
rcMain
.
top
>
mon_info
.
rcMonitor
.
top
&&
rcMain
.
bottom
<
mon_info
.
rcMonitor
.
bottom
,
"Test %u: window should not be fullscreen
\n
"
,
i
);
rcMaximized
=
(
test_style
[
i
]
&
WS_MAXIMIZEBOX
)
?
mon_info
.
rcWork
:
mon_info
.
rcMonitor
;
AdjustWindowRectEx
(
&
rcMaximized
,
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
~
WS_BORDER
,
0
,
GetWindowLongA
(
hwnd
,
GWL_EXSTYLE
));
ret
=
ShowWindow
(
hwnd
,
SW_MAXIMIZE
);
ok
(
ret
,
"unexpected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_MAXIMIZE
,
"Test %u: window should be maximized
\n
"
,
i
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMaximized
,
&
rc
),
"Test %u: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_rect
(
&
rcMaximized
),
wine_dbgstr_rect
(
&
rc
));
ret
=
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"unexpected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"Test %u: window should not be maximized
\n
"
,
i
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"Test %u: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_rect
(
&
rcMain
),
wine_dbgstr_rect
(
&
rc
));
DestroyWindow
(
hwnd
);
flush_events
(
TRUE
);
}
}
}
static
void
test_ShowWindow_owned
(
HWND
hwndMain
)
static
void
test_ShowWindow_owned
(
HWND
hwndMain
)
...
...
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