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
c75e0652
Commit
c75e0652
authored
Jan 06, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for release of capture via modal dialogs.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
522b2301
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
dialog.c
dlls/user32/tests/dialog.c
+84
-0
No files found.
dlls/user32/tests/dialog.c
View file @
c75e0652
...
...
@@ -2174,6 +2174,89 @@ static void test_dialog_custom_data(void)
DialogBoxA
(
g_hinst
,
"CUSTOM_TEST_DIALOG"
,
NULL
,
custom_test_dialog_proc
);
}
static
INT_PTR
CALLBACK
capture_release_proc
(
HWND
dialog
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
message
==
WM_INITDIALOG
)
{
HWND
child
=
(
HWND
)
lparam
;
DWORD
style
;
ok
(
GetCapture
()
==
child
,
"got capture %p
\n
"
,
GetCapture
());
style
=
GetWindowLongA
(
child
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"child should not be disabled
\n
"
);
PostMessageA
(
dialog
,
WM_USER
,
0
,
(
LPARAM
)
child
);
}
else
if
(
message
==
WM_USER
)
{
HWND
child
=
(
HWND
)
lparam
;
DWORD
style
;
todo_wine
ok
(
!
GetCapture
(),
"got capture %p
\n
"
,
GetCapture
());
style
=
GetWindowLongA
(
child
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"child should not be disabled
\n
"
);
EndDialog
(
dialog
,
1
);
}
return
FALSE
;
}
static
INT_PTR
CALLBACK
capture_release_modeless_proc
(
HWND
dialog
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
message
==
WM_INITDIALOG
)
{
HWND
child
=
(
HWND
)
lparam
;
DWORD
style
;
ok
(
GetCapture
()
==
child
,
"got capture %p
\n
"
,
GetCapture
());
style
=
GetWindowLongA
(
child
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"child should not be disabled
\n
"
);
PostMessageA
(
dialog
,
WM_QUIT
,
0
,
0
);
}
return
FALSE
;
}
static
void
test_capture_release
(
void
)
{
HWND
window
,
child
,
dialog
;
INT_PTR
ret
;
MSG
msg
;
/* Set the capture to a child window. The main window will receive
* WM_CANCELMODE when being disabled, but the child window will retain
* capture. */
window
=
CreateWindowA
(
"static"
,
"parent"
,
0
,
100
,
200
,
300
,
400
,
NULL
,
NULL
,
NULL
,
NULL
);
child
=
CreateWindowA
(
"static"
,
"child"
,
WS_CHILD
,
10
,
20
,
100
,
100
,
window
,
NULL
,
NULL
,
NULL
);
SetCapture
(
child
);
ret
=
DialogBoxParamA
(
GetModuleHandleA
(
NULL
),
"TEST_EMPTY_DIALOG"
,
NULL
,
capture_release_proc
,
(
LPARAM
)
child
);
ok
(
ret
==
1
,
"got %#Ix
\n
"
,
ret
);
todo_wine
ok
(
!
GetCapture
(),
"got capture %p
\n
"
,
GetCapture
());
SetCapture
(
child
);
ret
=
DialogBoxParamA
(
GetModuleHandleA
(
NULL
),
"TEST_EMPTY_DIALOG"
,
window
,
capture_release_proc
,
(
LPARAM
)
child
);
ok
(
ret
==
1
,
"got %#Ix
\n
"
,
ret
);
todo_wine
ok
(
!
GetCapture
(),
"got capture %p
\n
"
,
GetCapture
());
SetCapture
(
child
);
dialog
=
CreateDialogParamA
(
GetModuleHandleA
(
NULL
),
"TEST_EMPTY_DIALOG"
,
window
,
capture_release_modeless_proc
,
(
LPARAM
)
child
);
ok
(
!!
dialog
,
"failed to create dialog
\n
"
);
ok
(
GetCapture
()
==
child
,
"got capture %p
\n
"
,
GetCapture
());
ShowWindow
(
dialog
,
SW_SHOWNORMAL
);
ok
(
GetCapture
()
==
child
,
"got capture %p
\n
"
,
GetCapture
());
while
(
GetMessageA
(
&
msg
,
NULL
,
0
,
0
))
DispatchMessageA
(
&
msg
);
ok
(
GetCapture
()
==
child
,
"got capture %p
\n
"
,
GetCapture
());
DestroyWindow
(
dialog
);
DestroyWindow
(
child
);
DestroyWindow
(
window
);
}
START_TEST
(
dialog
)
{
g_hinst
=
GetModuleHandleA
(
0
);
...
...
@@ -2193,4 +2276,5 @@ START_TEST(dialog)
test_SaveRestoreFocus
();
test_timer_message
();
test_MessageBox
();
test_capture_release
();
}
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