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
be01a763
Commit
be01a763
authored
Nov 18, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Test messages on focus loss.
parent
9d63e3f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
290 additions
and
122 deletions
+290
-122
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+71
-29
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+73
-31
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+73
-31
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+73
-31
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
be01a763
...
...
@@ -428,12 +428,26 @@ static void destroy_material(IDirect3DMaterial *material)
IDirect3DMaterial_Release
(
material
);
}
static
const
UINT
*
expect_messages
;
struct
message
{
UINT
message
;
BOOL
check_wparam
;
WPARAM
expect_wparam
;
};
static
const
struct
message
*
expect_messages
;
static
LRESULT
CALLBACK
test_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
expect_messages
&&
message
==
*
expect_messages
)
if
(
expect_messages
&&
message
==
expect_messages
->
message
)
{
if
(
expect_messages
->
check_wparam
)
ok
(
wparam
==
expect_messages
->
expect_wparam
,
"Got unexpected wparam %lx for message %x, expected %lx.
\n
"
,
wparam
,
message
,
expect_messages
->
expect_wparam
);
++
expect_messages
;
}
return
DefWindowProcA
(
hwnd
,
message
,
wparam
,
lparam
);
}
...
...
@@ -1878,15 +1892,15 @@ static void test_wndproc(void)
HRESULT
hr
;
ULONG
ref
;
static
const
UINT
messages
[]
=
static
struct
message
messages
[]
=
{
WM_WINDOWPOSCHANGING
,
WM_MOVE
,
WM_SIZE
,
WM_WINDOWPOSCHANGING
,
WM_ACTIVATE
,
WM_SETFOCUS
,
0
,
{
WM_WINDOWPOSCHANGING
,
FALSE
,
0
}
,
{
WM_MOVE
,
FALSE
,
0
}
,
{
WM_SIZE
,
FALSE
,
0
}
,
{
WM_WINDOWPOSCHANGING
,
FALSE
,
0
}
,
{
WM_ACTIVATE
,
FALSE
,
0
}
,
{
WM_SETFOCUS
,
FALSE
,
0
}
,
{
0
,
FALSE
,
0
}
,
};
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
...
...
@@ -1906,7 +1920,7 @@ static void test_wndproc(void)
expect_messages
=
messages
;
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx, got %#lx.
\n
"
,
...
...
@@ -2147,19 +2161,34 @@ static void test_coop_level_mode_set(void)
BOOL
ret
;
LONG
change_ret
;
static
const
UINT
exclusive_messages
[]
=
static
const
struct
message
exclusive_messages
[]
=
{
{
WM_WINDOWPOSCHANGING
,
FALSE
,
0
},
{
WM_WINDOWPOSCHANGED
,
FALSE
,
0
},
{
WM_SIZE
,
FALSE
,
0
},
{
WM_DISPLAYCHANGE
,
FALSE
,
0
},
{
0
,
FALSE
,
0
},
};
static
const
struct
message
exclusive_focus_loss_messages
[]
=
{
WM_WINDOWPOSCHANGING
,
WM_WINDOWPOSCHANGED
,
WM_SIZE
,
WM_DISPLAYCHANGE
,
0
,
{
WM_ACTIVATE
,
TRUE
,
WA_INACTIVE
},
/*{WM_DISPLAYCHANGE, FALSE, 0}, Not yet implemented on Wine. */
{
WM_WINDOWPOSCHANGING
,
FALSE
,
0
},
/* Like d3d8 and d3d9 ddraw seems to use SW_SHOWMINIMIZED instead of
* SW_MINIMIZED, causing a recursive window activation that does not
* produe the same result in Wine yet. Ignore the difference for now.
* {WM_ACTIVATE, TRUE, 0x200000 | WA_ACTIVE}, */
{
WM_WINDOWPOSCHANGED
,
FALSE
,
0
},
{
WM_MOVE
,
FALSE
,
0
},
{
WM_SIZE
,
TRUE
,
SIZE_MINIMIZED
},
{
WM_ACTIVATEAPP
,
TRUE
,
FALSE
},
{
0
,
FALSE
,
0
},
};
static
const
UINT
normal_messages
[]
=
static
const
struct
message
normal_messages
[]
=
{
WM_DISPLAYCHANGE
,
0
,
{
WM_DISPLAYCHANGE
,
FALSE
,
0
}
,
{
0
,
FALSE
,
0
}
,
};
ddraw
=
create_ddraw
();
...
...
@@ -2234,7 +2263,7 @@ static void test_coop_level_mode_set(void)
hr
=
set_display_mode
(
ddraw
,
param
.
ddraw_width
,
param
.
ddraw_height
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
screen_size
.
cx
==
param
.
ddraw_width
&&
screen_size
.
cy
==
param
.
ddraw_height
,
"Expected screen size %ux%u, got %ux%u.
\n
"
,
...
...
@@ -2280,7 +2309,7 @@ static void test_coop_level_mode_set(void)
change_ret
=
ChangeDisplaySettingsW
(
&
devmode
,
CDS_FULLSCREEN
);
ok
(
change_ret
==
DISP_CHANGE_SUCCESSFUL
,
"Failed to change display mode, ret %#x.
\n
"
,
change_ret
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
screen_size
.
cx
==
param
.
user32_width
&&
screen_size
.
cy
==
param
.
user32_height
,
"Expected screen size %ux%u, got %ux%u.
\n
"
,
...
...
@@ -2291,6 +2320,19 @@ static void test_coop_level_mode_set(void)
user32_rect
.
left
,
user32_rect
.
top
,
user32_rect
.
right
,
user32_rect
.
bottom
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
expect_messages
=
exclusive_focus_loss_messages
;
ret
=
SetForegroundWindow
(
GetDesktopWindow
());
ok
(
ret
,
"Failed to set foreground window.
\n
"
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
ShowWindow
(
window
,
SW_RESTORE
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
/* Normally the primary should be restored here. Unfortunately this causes the
* GetSurfaceDesc call after the next display mode change to crash on the Windows 8
* testbot. Another Restore call would presumably avoid the crash, but it also moots
* the point of the GetSurfaceDesc call. */
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_NOREMOVE
);
expect_messages
=
exclusive_messages
;
screen_size
.
cx
=
0
;
...
...
@@ -2299,7 +2341,7 @@ static void test_coop_level_mode_set(void)
hr
=
IDirectDraw_RestoreDisplayMode
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"RestoreDisplayMode failed, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
todo_wine
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
todo_wine
ok
(
screen_size
.
cx
==
registry_mode
.
dmPelsWidth
&&
screen_size
.
cy
==
registry_mode
.
dmPelsHeight
,
...
...
@@ -2385,7 +2427,7 @@ static void test_coop_level_mode_set(void)
change_ret
=
ChangeDisplaySettingsW
(
&
devmode
,
CDS_FULLSCREEN
);
ok
(
change_ret
==
DISP_CHANGE_SUCCESSFUL
,
"Failed to change display mode, ret %#x.
\n
"
,
change_ret
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
@@ -2409,7 +2451,7 @@ static void test_coop_level_mode_set(void)
}
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
@@ -2453,7 +2495,7 @@ static void test_coop_level_mode_set(void)
hr
=
IDirectDraw_RestoreDisplayMode
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"RestoreDisplayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
@@ -2548,7 +2590,7 @@ static void test_coop_level_mode_set(void)
change_ret
=
ChangeDisplaySettingsW
(
&
devmode
,
CDS_FULLSCREEN
);
ok
(
change_ret
==
DISP_CHANGE_SUCCESSFUL
,
"Failed to change display mode, ret %#x.
\n
"
,
change_ret
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
@@ -2565,7 +2607,7 @@ static void test_coop_level_mode_set(void)
hr
=
set_display_mode
(
ddraw
,
param
.
ddraw_width
,
param
.
ddraw_height
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set display mode, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
@@ -2609,7 +2651,7 @@ static void test_coop_level_mode_set(void)
hr
=
IDirectDraw_RestoreDisplayMode
(
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"RestoreDisplayMode failed, hr %#x.
\n
"
,
hr
);
ok
(
!
*
expect_messages
,
"Expected message %#x, but didn't receive it.
\n
"
,
*
expect_messages
);
ok
(
!
expect_messages
->
message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_messages
->
message
);
expect_messages
=
NULL
;
ok
(
!
screen_size
.
cx
&&
!
screen_size
.
cy
,
"Got unexpected screen size %ux%u.
\n
"
,
screen_size
.
cx
,
screen_size
.
cy
);
...
...
dlls/ddraw/tests/ddraw2.c
View file @
be01a763
This diff is collapsed.
Click to expand it.
dlls/ddraw/tests/ddraw4.c
View file @
be01a763
This diff is collapsed.
Click to expand it.
dlls/ddraw/tests/ddraw7.c
View file @
be01a763
This diff is collapsed.
Click to expand it.
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