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
26be2913
Commit
26be2913
authored
Dec 08, 2016
by
Lauri Kenttä
Committed by
Alexandre Julliard
Dec 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for LockWindowUpdate.
Signed-off-by:
Lauri Kenttä
<
lauri.kentta@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c0f77b4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
win.c
dlls/user32/tests/win.c
+71
-0
No files found.
dlls/user32/tests/win.c
View file @
26be2913
...
...
@@ -9325,6 +9325,76 @@ todo_wine
ok
(
ret
,
"got %d
\n
"
,
ret
);
}
static
void
test_LockWindowUpdate
(
HWND
parent
)
{
typedef
struct
{
HWND
hwnd_lock
,
hwnd_draw
;
BOOL
allow_drawing
;
BOOL
expect_valid
;
}
TEST
;
int
i
;
HWND
child
=
CreateWindowA
(
"static"
,
0
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
20
,
20
,
parent
,
0
,
0
,
0
);
TEST
tests
[]
=
{
{
child
,
child
,
0
,
0
},
{
child
,
child
,
1
,
1
},
{
child
,
parent
,
0
,
1
},
{
child
,
parent
,
1
,
1
},
{
parent
,
child
,
0
,
0
},
{
parent
,
child
,
1
,
1
},
{
parent
,
parent
,
0
,
0
},
{
parent
,
parent
,
1
,
1
}
};
if
(
!
child
)
{
skip
(
"CreateWindow failed, skipping LockWindowUpdate tests
\n
"
);
return
;
}
ShowWindow
(
parent
,
SW_SHOW
);
UpdateWindow
(
parent
);
flush_events
(
TRUE
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
++
i
)
{
HDC
hdc
;
POINT
p
=
{
10
,
10
};
BOOL
ret
;
const
DWORD
dc_flags
=
DCX_USESTYLE
|
(
tests
[
i
].
allow_drawing
?
DCX_LOCKWINDOWUPDATE
:
0
);
const
COLORREF
c1
=
0x111100
,
c2
=
0x222200
;
trace
(
"hwnd_lock = %s, hwnd_draw = %s, allow_drawing = %d
\n
"
,
tests
[
i
].
hwnd_lock
==
parent
?
"parent"
:
"child"
,
tests
[
i
].
hwnd_draw
==
parent
?
"parent"
:
"child"
,
tests
[
i
].
allow_drawing
);
hdc
=
GetDCEx
(
tests
[
i
].
hwnd_draw
,
0
,
dc_flags
);
#define TEST_PIXEL(c_valid, c_invalid) \
do { \
COLORREF c = GetPixel(hdc, p.x, p.y); \
COLORREF e = tests[i].expect_valid ? (c_valid) : (c_invalid); \
todo_wine_if(!tests[i].expect_valid) \
ok(c == e, "GetPixel: got %08x, expected %08x\n", c, e); \
} while (0)
SetPixel
(
hdc
,
p
.
x
,
p
.
y
,
c1
);
ret
=
LockWindowUpdate
(
tests
[
i
].
hwnd_lock
);
ok
(
ret
,
"LockWindowUpdate failed
\n
"
);
TEST_PIXEL
(
c1
,
CLR_INVALID
);
SetPixel
(
hdc
,
p
.
x
,
p
.
y
,
c2
);
TEST_PIXEL
(
c2
,
CLR_INVALID
);
LockWindowUpdate
(
0
);
TEST_PIXEL
(
c2
,
c1
);
ReleaseDC
(
tests
[
i
].
hwnd_draw
,
hdc
);
#undef TEST_PIXEL
}
DestroyWindow
(
child
);
}
START_TEST
(
win
)
{
char
**
argv
;
...
...
@@ -9470,6 +9540,7 @@ START_TEST(win)
test_activateapp
(
hwndMain
);
test_winproc_handles
(
argv
[
0
]);
test_deferwindowpos
();
test_LockWindowUpdate
(
hwndMain
);
/* add the tests above this line */
if
(
hhook
)
UnhookWindowsHookEx
(
hhook
);
...
...
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