Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
229fb8a4
Commit
229fb8a4
authored
13 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
user32: Add some SetFocus message tests.
parent
f6ccb2c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/user32/tests/msg.c
+100
-0
100 additions, 0 deletions
dlls/user32/tests/msg.c
with
100 additions
and
0 deletions
dlls/user32/tests/msg.c
+
100
−
0
View file @
229fb8a4
...
...
@@ -13490,6 +13490,105 @@ end:
flush_sequence();
}
static const struct message WmSetFocus_1[] = {
{ HCBT_SETFOCUS, hook }, /* child */
{ HCBT_ACTIVATE, hook }, /* parent */
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|parent|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|parent, 0, SWP_NOSIZE|SWP_NOMOVE },
{ WM_ACTIVATEAPP, sent|wparam|parent, 1 },
{ WM_NCACTIVATE, sent|wparam|parent, 1 },
{ WM_GETTEXT, sent|defwinproc|parent|optional },
{ WM_GETTEXT, sent|defwinproc|parent|optional },
{ WM_ACTIVATE, sent|wparam|parent, 1 },
{ HCBT_SETFOCUS, hook }, /* parent */
{ WM_SETFOCUS, sent|defwinproc|parent },
{ WM_KILLFOCUS, sent|parent },
{ WM_SETFOCUS, sent },
{ 0 }
};
static const struct message WmSetFocus_2[] = {
{ HCBT_SETFOCUS, hook }, /* parent */
{ WM_KILLFOCUS, sent },
{ WM_SETFOCUS, sent|parent },
{ 0 }
};
static const struct message WmSetFocus_3[] = {
{ HCBT_SETFOCUS, hook }, /* child */
{ 0 }
};
static const struct message WmSetFocus_4[] = {
{ 0 }
};
static void test_SetFocus(void)
{
HWND parent, old_parent, child, old_focus;
MSG msg;
parent = CreateWindowEx(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
0, 0, 0, 0, 0, 0, 0, NULL);
ok(parent != 0, "failed to create parent window\n");
child = CreateWindowEx(0, "TestWindowClass", NULL, WS_CHILD,
0, 0, 0, 0, parent, 0, 0, NULL);
ok(child != 0, "failed to create child window\n");
trace("parent %p, child %p\n", parent, child);
SetFocus(0);
SetActiveWindow(0);
flush_events();
flush_sequence();
ok(GetActiveWindow() == 0, "expected active 0, got %p\n", GetActiveWindow());
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
log_all_parent_messages++;
old_focus = SetFocus(child);
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
ok_sequence(WmSetFocus_1, "SetFocus on a child window", TRUE);
ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == child, "expected focus %p, got %p\n", child, GetFocus());
old_focus = SetFocus(parent);
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
ok_sequence(WmSetFocus_2, "SetFocus on a parent window", FALSE);
ok(old_focus == child, "expected old focus %p, got %p\n", child, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
old_parent = SetParent(child, GetDesktopWindow());
ok(old_parent == parent, "expected old parent %p, got %p\n", parent, old_parent);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
flush_events();
flush_sequence();
old_focus = SetFocus(child);
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
ok_sequence(WmSetFocus_3, "SetFocus on a child window", TRUE);
ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
old_focus = SetActiveWindow(child);
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg);
ok_sequence(WmEmptySeq, "SetActiveWindow on a child window", FALSE);
ok(old_focus == parent, "expected old active %p, got %p\n", parent, old_focus);
ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
log_all_parent_messages--;
DestroyWindow(child);
DestroyWindow(parent);
}
START_TEST(msg)
{
char **test_argv;
...
...
@@ -13553,6 +13652,7 @@ START_TEST(msg)
hEvent_hook = 0;
#endif
test_SetFocus();
test_SetParent();
test_PostMessage();
test_ShowWindow();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment