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
d8568e90
Commit
d8568e90
authored
Mar 15, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/tests: Try harder to flush X events before running tests.
parent
a2a4029e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
9 deletions
+36
-9
msg.c
dlls/user/tests/msg.c
+20
-9
win.c
dlls/user/tests/win.c
+16
-0
No files found.
dlls/user/tests/msg.c
View file @
d8568e90
...
...
@@ -1282,6 +1282,21 @@ static void add_message(const struct message *msg)
sequence_cnt
++
;
}
/* try to make sure pending X events have been processed before continuing */
static
void
flush_events
(
void
)
{
MSG
msg
;
int
diff
=
100
;
DWORD
time
=
GetTickCount
()
+
diff
;
while
(
diff
>
0
)
{
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
diff
,
QS_ALLINPUT
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
diff
=
time
-
GetTickCount
();
}
}
static
void
flush_sequence
(
void
)
{
HeapFree
(
GetProcessHeap
(),
0
,
sequence
);
...
...
@@ -3938,10 +3953,7 @@ static void test_paint_messages(void)
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
/* try to flush pending X expose events */
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
100
,
QS_ALLINPUT
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
flush_events
();
check_update_rgn
(
hwnd
,
0
);
SetRectRgn
(
hrgn
,
10
,
10
,
20
,
20
);
...
...
@@ -4142,10 +4154,7 @@ static void test_paint_messages(void)
ShowWindow
(
hparent
,
SW_SHOW
);
UpdateWindow
(
hparent
);
UpdateWindow
(
hchild
);
/* try to flush pending X expose events */
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
100
,
QS_ALLINPUT
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
flush_events
();
flush_sequence
();
log_all_parent_messages
++
;
...
...
@@ -4702,6 +4711,7 @@ static void test_accelerators(void)
assert
(
hwnd
!=
0
);
UpdateWindow
(
hwnd
);
flush_events
();
SetFocus
(
hwnd
);
ok
(
GetFocus
()
==
hwnd
,
"wrong focus window %p
\n
"
,
GetFocus
());
...
...
@@ -6171,7 +6181,7 @@ static void test_scrollwindowex(void)
10
,
10
,
150
,
150
,
hwnd
,
0
,
0
,
NULL
);
ok
(
hchild
!=
0
,
"Failed to create child
\n
"
);
UpdateWindow
(
hwnd
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
flush_events
(
);
flush_sequence
();
/* scroll without the child window */
...
...
@@ -6424,6 +6434,7 @@ static void test_DispatchMessage(void)
if
(
++
count
>
10
)
break
;
}
}
DestroyWindow
(
hwnd
);
}
...
...
dlls/user/tests/win.c
View file @
d8568e90
...
...
@@ -60,6 +60,21 @@ static HMENU hmenu;
#define COUNTOF(arr) (sizeof(arr)/sizeof(arr[0]))
/* try to make sure pending X events have been processed before continuing */
static
void
flush_events
(
void
)
{
MSG
msg
;
int
diff
=
100
;
DWORD
time
=
GetTickCount
()
+
diff
;
while
(
diff
>
0
)
{
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
diff
,
QS_ALLINPUT
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
diff
=
time
-
GetTickCount
();
}
}
/* check the values returned by the various parent/owner functions on a given window */
static
void
check_parents
(
HWND
hwnd
,
HWND
ga_parent
,
HWND
gwl_parent
,
HWND
get_parent
,
HWND
gw_owner
,
HWND
ga_root
,
HWND
ga_root_owner
)
...
...
@@ -3423,6 +3438,7 @@ static void test_csparentdc(void)
ShowWindow
(
hwndMain
,
SW_SHOW
);
ShowWindow
(
hwnd1
,
SW_SHOW
);
ShowWindow
(
hwnd2
,
SW_SHOW
);
flush_events
();
zero_parentdc_test
(
&
test_answer
);
InvalidateRect
(
hwndMain
,
NULL
,
TRUE
);
...
...
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