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
ef60604d
Commit
ef60604d
authored
Nov 17, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test style changes on focus loss.
parent
9bcd9722
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
8 deletions
+117
-8
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+80
-5
device.c
dlls/d3d9/tests/device.c
+37
-3
No files found.
dlls/d3d9/tests/d3d9ex.c
View file @
ef60604d
...
...
@@ -2227,24 +2227,27 @@ done:
static
void
test_window_style
(
void
)
{
RECT
focus_rect
,
device_rect
,
fullscreen_rect
,
r
,
r2
;
LONG
device_style
,
device_exstyle
;
LONG
device_style
,
device_exstyle
,
expected_style
;
LONG
focus_style
,
focus_exstyle
;
struct
device_desc
device_desc
;
LONG
style
;
IDirect3DDevice9Ex
*
device
;
HRESULT
hr
;
ULONG
ref
;
BOOL
ret
;
static
const
struct
{
LONG
style_flags
;
DWORD
device_flags
;
LONG
focus_loss_style
;
LONG
create2_style
,
create2_exstyle
;
}
tests
[]
=
{
{
0
,
0
},
{
WS_VISIBLE
,
0
},
{
0
,
CREATE_DEVICE_NOWINDOWCHANGES
},
{
WS_VISIBLE
,
CREATE_DEVICE_NOWINDOWCHANGES
},
{
0
,
0
,
0
,
WS_VISIBLE
,
WS_EX_TOPMOST
},
{
WS_VISIBLE
,
0
,
WS_MINIMIZE
,
WS_VISIBLE
,
WS_EX_TOPMOST
},
{
0
,
CREATE_DEVICE_NOWINDOWCHANGES
,
0
,
0
,
0
},
{
WS_VISIBLE
,
CREATE_DEVICE_NOWINDOWCHANGES
,
0
,
0
,
0
},
};
unsigned
int
i
;
...
...
@@ -2332,6 +2335,78 @@ static void test_window_style(void)
ref
=
IDirect3DDevice9Ex_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
if
(
device_style
&
WS_VISIBLE
)
ok
(
style
==
device_style
,
"Expected device window style %#x, got %#x, i=%u.
\n
"
,
device_style
,
style
,
i
);
else
todo_wine
ok
(
style
==
device_style
,
"Expected device window style %#x, got %#x, i=%u.
\n
"
,
device_style
,
style
,
i
);
style
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
todo_wine
ok
(
style
==
device_exstyle
,
"Expected device window extended style %#x, got %#x, i=%u.
\n
"
,
device_exstyle
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
ok
(
style
==
focus_style
,
"Expected focus window style %#x, got %#x, i=%u.
\n
"
,
focus_style
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x, i=%u.
\n
"
,
focus_exstyle
,
style
,
i
);
/* The second time a device is created on the window the window becomes visible and
* topmost if D3DCREATE_NOWINDOWCHANGES is not set. */
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
|
tests
[
i
].
device_flags
;
device
=
create_device
(
focus_window
,
&
device_desc
);
ok
(
!!
device
,
"Failed to create a D3D device.
\n
"
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
expected_style
=
device_style
|
tests
[
i
].
create2_style
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window style %#x, got %#x, i=%u.
\n
"
,
expected_style
,
style
,
i
);
expected_style
=
device_exstyle
|
tests
[
i
].
create2_exstyle
;
style
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
todo_wine
ok
(
style
==
expected_style
,
"Expected device window extended style %#x, got %#x, i=%u.
\n
"
,
expected_style
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
ok
(
style
==
focus_style
,
"Expected focus window style %#x, got %#x, i=%u.
\n
"
,
focus_style
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x, i=%u.
\n
"
,
focus_exstyle
,
style
,
i
);
ref
=
IDirect3DDevice9Ex_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
DestroyWindow
(
device_window
);
DestroyWindow
(
focus_window
);
focus_window
=
CreateWindowA
(
"d3d9_test_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
tests
[
i
].
style_flags
,
0
,
0
,
registry_mode
.
dmPelsWidth
/
2
,
registry_mode
.
dmPelsHeight
/
2
,
0
,
0
,
0
,
0
);
device_window
=
CreateWindowA
(
"d3d9_test_wc"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
tests
[
i
].
style_flags
,
0
,
0
,
registry_mode
.
dmPelsWidth
/
2
,
registry_mode
.
dmPelsHeight
/
2
,
0
,
0
,
0
,
0
);
device_desc
.
device_window
=
device_window
;
device
=
create_device
(
focus_window
,
&
device_desc
);
ok
(
!!
device
,
"Failed to create a D3D device.
\n
"
);
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
expected_style
=
device_style
|
tests
[
i
].
focus_loss_style
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window style %#x, got %#x, i=%u.
\n
"
,
expected_style
,
style
,
i
);
style
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
todo_wine
ok
(
style
==
device_exstyle
,
"Expected device window extended style %#x, got %#x, i=%u.
\n
"
,
device_exstyle
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
ok
(
style
==
focus_style
,
"Expected focus window style %#x, got %#x, i=%u.
\n
"
,
focus_style
,
style
,
i
);
style
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x, i=%u.
\n
"
,
focus_exstyle
,
style
,
i
);
ref
=
IDirect3DDevice9Ex_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
DestroyWindow
(
device_window
);
DestroyWindow
(
focus_window
);
}
...
...
dlls/d3d9/tests/device.c
View file @
ef60604d
...
...
@@ -3796,15 +3796,16 @@ static void test_window_style(void)
IDirect3D9
*
d3d9
;
HRESULT
hr
;
ULONG
ref
;
BOOL
ret
;
static
const
struct
{
DWORD
device_flags
;
LONG
style
,
exstyle
;
LONG
style
,
focus_loss_style
,
exstyle
;
}
tests
[]
=
{
{
0
,
WS_VISIBLE
,
WS_EX_TOPMOST
},
{
CREATE_DEVICE_NOWINDOWCHANGES
,
0
},
{
0
,
WS_VISIBLE
,
WS_MINIMIZE
,
WS_EX_TOPMOST
},
{
CREATE_DEVICE_NOWINDOWCHANGES
,
0
,
0
,
0
},
};
unsigned
int
i
;
...
...
@@ -3899,6 +3900,39 @@ static void test_window_style(void)
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x, i=%u.
\n
"
,
focus_exstyle
,
style
,
i
);
device_desc
.
flags
=
CREATE_DEVICE_FULLSCREEN
;
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
style
=
GetWindowLongA
(
device_window
,
GWL_STYLE
);
expected_style
=
device_style
|
tests
[
i
].
focus_loss_style
|
tests
[
i
].
style
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window style %#x, got %#x.
\n
"
,
expected_style
,
style
);
style
=
GetWindowLongA
(
device_window
,
GWL_EXSTYLE
);
expected_style
=
device_exstyle
|
tests
[
i
].
exstyle
;
todo_wine
ok
(
style
==
expected_style
,
"Expected device window extended style %#x, got %#x.
\n
"
,
expected_style
,
style
);
style
=
GetWindowLongA
(
focus_window
,
GWL_STYLE
);
ok
(
style
==
focus_style
,
"Expected focus window style %#x, got %#x.
\n
"
,
focus_style
,
style
);
style
=
GetWindowLongA
(
focus_window
,
GWL_EXSTYLE
);
ok
(
style
==
focus_exstyle
,
"Expected focus window extended style %#x, got %#x.
\n
"
,
focus_exstyle
,
style
);
/* In d3d8 follow-up tests fail on native if the device is destroyed while
* lost. This doesn't happen in d3d9 on my test machine but it still seems
* like a good idea to reset it first. */
ShowWindow
(
focus_window
,
SW_MINIMIZE
);
ShowWindow
(
focus_window
,
SW_RESTORE
);
ret
=
SetForegroundWindow
(
focus_window
);
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
flush_events
();
hr
=
reset_device
(
device
,
&
device_desc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to reset device, hr %#x.
\n
"
,
hr
);
ref
=
IDirect3DDevice9_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
...
...
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