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
f217636e
Commit
f217636e
authored
Dec 04, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/test: Test WM_SYSCOMMAND handling.
parent
e8ce1085
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
171 additions
and
0 deletions
+171
-0
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+88
-0
device.c
dlls/d3d9/tests/device.c
+83
-0
No files found.
dlls/d3d9/tests/d3d9ex.c
View file @
f217636e
...
...
@@ -1898,6 +1898,32 @@ static void test_wndproc(void)
{
WM_ACTIVATEAPP
,
FOCUS_WINDOW
,
TRUE
,
FALSE
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_restore_messages
[]
=
{
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_SIZE
,
FOCUS_WINDOW
,
TRUE
,
SIZE_RESTORED
},
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_RESTORE
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_minimize_messages
[]
=
{
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_MINIMIZE
},
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_MOVE
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_SIZE
,
FOCUS_WINDOW
,
TRUE
,
SIZE_MINIMIZED
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_maximize_messages
[]
=
{
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_MAXIMIZE
},
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_MOVE
,
FOCUS_WINDOW
,
FALSE
,
0
},
/* WM_SIZE(SIZE_MAXIMIZED) is unreliable on native. */
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
{
DWORD
create_flags
;
...
...
@@ -2131,12 +2157,42 @@ static void test_wndproc(void)
expect_messages
->
message
,
expect_messages
->
window
,
i
);
ok
(
!
windowposchanged_received
,
"Received WM_WINDOWPOSCHANGED but did not expect it, i=%u.
\n
"
,
i
);
expect_messages
=
NULL
;
flush_events
();
ret
=
EnumDisplaySettingsW
(
NULL
,
ENUM_CURRENT_SETTINGS
,
&
devmode
);
ok
(
ret
,
"Failed to get display mode.
\n
"
);
ok
(
devmode
.
dmPelsWidth
==
registry_mode
.
dmPelsWidth
,
"Got unexpect width %u.
\n
"
,
devmode
.
dmPelsWidth
);
ok
(
devmode
.
dmPelsHeight
==
registry_mode
.
dmPelsHeight
,
"Got unexpect height %u.
\n
"
,
devmode
.
dmPelsHeight
);
/* SW_SHOWMINNOACTIVE is needed to make FVWM happy. SW_SHOWNOACTIVATE is needed to make windows
* send SIZE_RESTORED after ShowWindow(SW_SHOWMINNOACTIVE). */
ShowWindow
(
focus_window
,
SW_SHOWNOACTIVATE
);
ShowWindow
(
focus_window
,
SW_SHOWMINNOACTIVE
);
flush_events
();
expect_messages
=
sc_restore_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
todo_wine
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_minimize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_maximize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
SetForegroundWindow
(
GetDesktopWindow
());
ShowWindow
(
device_window
,
SW_MINIMIZE
);
ShowWindow
(
device_window
,
SW_RESTORE
);
ShowWindow
(
focus_window
,
SW_MINIMIZE
);
ShowWindow
(
focus_window
,
SW_RESTORE
);
...
...
@@ -2160,6 +2216,9 @@ static void test_wndproc(void)
* device will show it again. */
filter_messages
=
NULL
;
ShowWindow
(
device_window
,
SW_HIDE
);
/* Remove the maximized state from the SYSCOMMAND test while we're not
* interfering with a device. */
ShowWindow
(
focus_window
,
SW_SHOWNORMAL
);
filter_messages
=
focus_window
;
device_desc
.
device_window
=
focus_window
;
...
...
@@ -2187,6 +2246,35 @@ static void test_wndproc(void)
ok
(
!
IsIconic
(
focus_window
)
==
!
tests
[
i
].
iconic
,
"Expected IsIconic %u, got %u, i=%u.
\n
"
,
tests
[
i
].
iconic
,
IsIconic
(
focus_window
),
i
);
ShowWindow
(
focus_window
,
SW_SHOWNOACTIVATE
);
ShowWindow
(
focus_window
,
SW_SHOWMINNOACTIVE
);
flush_events
();
expect_messages
=
sc_restore_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
todo_wine
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
/* For FVWM. */
ShowWindow
(
focus_window
,
SW_RESTORE
);
flush_events
();
expect_messages
=
sc_minimize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_maximize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
/* This test can't activate, drop focus and restore focus like in plain d3d9 because d3d9ex
* immediately restores the device on activation. There are plenty of WM_WINDOWPOSCHANGED
* messages that are generated by ShowWindow, so testing for their absence is pointless. */
...
...
dlls/d3d9/tests/device.c
View file @
f217636e
...
...
@@ -3328,6 +3328,32 @@ static void test_wndproc(void)
{
WM_ACTIVATEAPP
,
FOCUS_WINDOW
,
TRUE
,
TRUE
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_restore_messages
[]
=
{
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_SIZE
,
FOCUS_WINDOW
,
TRUE
,
SIZE_RESTORED
},
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_RESTORE
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_minimize_messages
[]
=
{
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_MINIMIZE
},
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_MOVE
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_SIZE
,
FOCUS_WINDOW
,
TRUE
,
SIZE_MINIMIZED
},
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
message
sc_maximize_messages
[]
=
{
{
WM_SYSCOMMAND
,
FOCUS_WINDOW
,
TRUE
,
SC_MAXIMIZE
},
{
WM_WINDOWPOSCHANGING
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FOCUS_WINDOW
,
FALSE
,
0
},
{
WM_MOVE
,
FOCUS_WINDOW
,
FALSE
,
0
},
/* WM_SIZE(SIZE_MAXIMIZED) is unreliable on native. */
{
0
,
0
,
FALSE
,
0
},
};
static
const
struct
{
DWORD
create_flags
;
...
...
@@ -3565,12 +3591,42 @@ static void test_wndproc(void)
expect_messages
->
message
,
expect_messages
->
window
,
i
);
ok
(
!
windowposchanged_received
,
"Received WM_WINDOWPOSCHANGED but did not expect it.
\n
"
);
expect_messages
=
NULL
;
flush_events
();
ret
=
EnumDisplaySettingsW
(
NULL
,
ENUM_CURRENT_SETTINGS
,
&
devmode
);
ok
(
ret
,
"Failed to get display mode.
\n
"
);
ok
(
devmode
.
dmPelsWidth
==
registry_mode
.
dmPelsWidth
,
"Got unexpect width %u.
\n
"
,
devmode
.
dmPelsWidth
);
ok
(
devmode
.
dmPelsHeight
==
registry_mode
.
dmPelsHeight
,
"Got unexpect height %u.
\n
"
,
devmode
.
dmPelsHeight
);
/* SW_SHOWMINNOACTIVE is needed to make FVWM happy. SW_SHOWNOACTIVATE is needed to make windows
* send SIZE_RESTORED after ShowWindow(SW_SHOWMINNOACTIVE). */
ShowWindow
(
focus_window
,
SW_SHOWNOACTIVATE
);
ShowWindow
(
focus_window
,
SW_SHOWMINNOACTIVE
);
flush_events
();
expect_messages
=
sc_restore_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
todo_wine
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_minimize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_maximize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
SetForegroundWindow
(
GetDesktopWindow
());
ShowWindow
(
device_window
,
SW_MINIMIZE
);
ShowWindow
(
device_window
,
SW_RESTORE
);
ShowWindow
(
focus_window
,
SW_MINIMIZE
);
ShowWindow
(
focus_window
,
SW_RESTORE
);
...
...
@@ -3599,6 +3655,9 @@ static void test_wndproc(void)
* device will show it again. */
filter_messages
=
NULL
;
ShowWindow
(
device_window
,
SW_HIDE
);
/* Remove the maximized state from the SYSCOMMAND test while we're not
* interfering with a device. */
ShowWindow
(
focus_window
,
SW_SHOWNORMAL
);
filter_messages
=
focus_window
;
device_desc
.
device_window
=
focus_window
;
...
...
@@ -3632,7 +3691,31 @@ static void test_wndproc(void)
if
(
tests
[
i
].
create_flags
&
CREATE_DEVICE_NOWINDOWCHANGES
)
ShowWindow
(
focus_window
,
SW_MINIMIZE
);
expect_messages
=
sc_restore_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
todo_wine
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
/* For FVWM. */
ShowWindow
(
focus_window
,
SW_RESTORE
);
flush_events
();
expect_messages
=
sc_minimize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
expect_messages
=
sc_maximize_messages
;
SendMessageA
(
focus_window
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x for window %#x, but didn't receive it, i=%u.
\n
"
,
expect_messages
->
message
,
expect_messages
->
window
,
i
);
expect_messages
=
NULL
;
flush_events
();
/* Make sure the SetWindowPos call done by d3d9 is not a no-op. */
SetWindowPos
(
focus_window
,
NULL
,
10
,
10
,
100
,
100
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
SetForegroundWindow
(
GetDesktopWindow
());
...
...
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