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
57e2b75c
Commit
57e2b75c
authored
Aug 25, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for inter-process clipboard viewer notifications.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
29fdc487
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
142 additions
and
2 deletions
+142
-2
clipboard.c
dlls/user32/tests/clipboard.c
+142
-2
No files found.
dlls/user32/tests/clipboard.c
View file @
57e2b75c
...
@@ -113,6 +113,22 @@ static void set_clipboard_data_process( int arg )
...
@@ -113,6 +113,22 @@ static void set_clipboard_data_process( int arg )
}
}
}
}
static
void
grab_clipboard_process
(
int
arg
)
{
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
OpenClipboard
(
0
);
ok
(
ret
,
"OpenClipboard failed
\n
"
);
ret
=
EmptyClipboard
();
ok
(
ret
,
"EmptyClipboard failed
\n
"
);
if
(
arg
)
{
HANDLE
ret
=
SetClipboardData
(
CF_WAVE
,
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_ZEROINIT
,
100
));
ok
(
ret
!=
0
,
"process %u: SetClipboardData failed err %u
\n
"
,
arg
,
GetLastError
()
);
}
}
static
void
run_thread
(
LPTHREAD_START_ROUTINE
func
,
void
*
arg
,
int
line
)
static
void
run_thread
(
LPTHREAD_START_ROUTINE
func
,
void
*
arg
,
int
line
)
{
{
DWORD
ret
;
DWORD
ret
;
...
@@ -733,11 +749,10 @@ static DWORD WINAPI clipboard_thread(void *param)
...
@@ -733,11 +749,10 @@ static DWORD WINAPI clipboard_thread(void *param)
ok
(
!
count
,
"WM_DRAWCLIPBOARD received
\n
"
);
ok
(
!
count
,
"WM_DRAWCLIPBOARD received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
ok
(
!
count
,
"WM_CLIPBOARDUPDATE received
\n
"
);
ok
(
!
count
,
"WM_CLIPBOARDUPDATE received
\n
"
);
formats
=
CountClipboardFormats
();
count
=
SendMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
count
=
SendMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
ok
(
!
count
,
"WM_DESTROYCLIPBOARD received
\n
"
);
ok
(
!
count
,
"WM_DESTROYCLIPBOARD received
\n
"
);
formats
=
CountClipboardFormats
();
r
=
OpenClipboard
(
0
);
r
=
OpenClipboard
(
0
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
r
=
EmptyClipboard
();
r
=
EmptyClipboard
();
...
@@ -745,11 +760,131 @@ static DWORD WINAPI clipboard_thread(void *param)
...
@@ -745,11 +760,131 @@ static DWORD WINAPI clipboard_thread(void *param)
r
=
CloseClipboard
();
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
count
=
SendMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
ok
(
count
,
"WM_DESTROYCLIPBOARD not received
\n
"
);
ok
(
count
,
"WM_DESTROYCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
count
=
SendMessageA
(
win
,
WM_USER
+
4
,
0
,
0
);
ok
(
count
==
formats
,
"wrong format count %u on WM_DESTROYCLIPBOARD
\n
"
,
count
);
ok
(
count
==
formats
,
"wrong format count %u on WM_DESTROYCLIPBOARD
\n
"
,
count
);
r
=
OpenClipboard
(
win
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
SetClipboardData
(
CF_WAVE
,
GlobalAlloc
(
GMEM_FIXED
,
1
));
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
ok
(
(
int
)(
seq
-
old_seq
)
>
0
,
"sequence unchanged
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
ok
(
!
count
,
"WM_CLIPBOARDUPDATE received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
ok
(
!
count
,
"WM_DESTROYCLIPBOARD received
\n
"
);
EnterCriticalSection
(
&
clipboard_cs
);
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
LeaveCriticalSection
(
&
clipboard_cs
);
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
run_process
(
"grab_clipboard 0"
);
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
ok
(
(
int
)(
seq
-
old_seq
)
>
0
,
"sequence unchanged
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
todo_wine
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
r
=
OpenClipboard
(
0
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
SetClipboardData
(
CF_WAVE
,
GlobalAlloc
(
GMEM_FIXED
,
1
));
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
todo_wine
ok
(
(
int
)(
seq
-
old_seq
)
>
0
,
"sequence unchanged
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
ok
(
!
count
,
"WM_DRAWCLIPBOARD received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
ok
(
!
count
,
"WM_CLIPBOARDUPDATE received
\n
"
);
EnterCriticalSection
(
&
clipboard_cs
);
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
LeaveCriticalSection
(
&
clipboard_cs
);
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
todo_wine
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
run_process
(
"grab_clipboard 1"
);
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
ok
(
(
int
)(
seq
-
old_seq
)
>
0
,
"sequence unchanged
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
todo_wine
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
r
=
OpenClipboard
(
0
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
SetClipboardData
(
CF_WAVE
,
GlobalAlloc
(
GMEM_FIXED
,
1
));
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
todo_wine
ok
(
(
int
)(
seq
-
old_seq
)
>
0
,
"sequence unchanged
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
ok
(
!
count
,
"WM_DRAWCLIPBOARD received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
ok
(
!
count
,
"WM_CLIPBOARDUPDATE received
\n
"
);
EnterCriticalSection
(
&
clipboard_cs
);
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
LeaveCriticalSection
(
&
clipboard_cs
);
if
(
pGetClipboardSequenceNumber
)
{
seq
=
pGetClipboardSequenceNumber
();
todo_wine
ok
(
seq
==
old_seq
,
"sequence changed
\n
"
);
old_seq
=
seq
;
}
count
=
SendMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
todo_wine
ok
(
count
,
"WM_DRAWCLIPBOARD not received
\n
"
);
count
=
SendMessageA
(
win
,
WM_USER
+
2
,
0
,
0
);
todo_wine
ok
(
count
||
broken
(
!
pAddClipboardFormatListener
),
"WM_CLIPBOARDUPDATE not received
\n
"
);
r
=
PostMessageA
(
win
,
WM_USER
,
0
,
0
);
r
=
PostMessageA
(
win
,
WM_USER
,
0
,
0
);
ok
(
r
,
"PostMessage failed: %d
\n
"
,
GetLastError
());
ok
(
r
,
"PostMessage failed: %d
\n
"
,
GetLastError
());
return
0
;
return
0
;
...
@@ -1110,6 +1245,11 @@ START_TEST(clipboard)
...
@@ -1110,6 +1245,11 @@ START_TEST(clipboard)
set_clipboard_data_process
(
atoi
(
argv
[
3
]
));
set_clipboard_data_process
(
atoi
(
argv
[
3
]
));
return
;
return
;
}
}
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"grab_clipboard"
))
{
grab_clipboard_process
(
atoi
(
argv
[
3
]
));
return
;
}
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"handles"
))
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"handles"
))
{
{
test_handles_process
(
argv
[
3
]
);
test_handles_process
(
argv
[
3
]
);
...
...
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