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
d437d61c
Commit
d437d61c
authored
Jan 02, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Added some tests for FindWindow().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a5d9d297
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
win.c
dlls/user32/tests/win.c
+67
-0
No files found.
dlls/user32/tests/win.c
View file @
d437d61c
...
...
@@ -7978,6 +7978,16 @@ static void test_FindWindowEx(void)
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
num_gettext_msgs
=
0
;
found
=
FindWindowExA
(
0
,
0
,
"ClassThatDoesntExist"
,
""
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowExA
(
0
,
0
,
"ClassThatDoesntExist"
,
NULL
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowExA
(
0
,
0
,
"MainWindowClass"
,
""
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
...
...
@@ -8016,6 +8026,62 @@ static void test_FindWindowEx(void)
ok
(
found
!=
NULL
,
"found is NULL, expected a valid hwnd
\n
"
);
}
static
void
test_FindWindow
(
void
)
{
HWND
hwnd
,
found
;
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
"caption"
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"ClassThatDoesntExist"
,
""
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"ClassThatDoesntExist"
,
NULL
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"MainWindowClass"
,
""
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"MainWindowClass"
,
NULL
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"MainWindowClass"
,
"caption"
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"MainWindowClass"
,
""
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
num_gettext_msgs
=
0
;
found
=
FindWindowA
(
"MainWindowClass"
,
NULL
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
ok
(
num_gettext_msgs
==
0
,
"got %u WM_GETTEXT messages
\n
"
,
num_gettext_msgs
);
DestroyWindow
(
hwnd
);
/* test behaviour with a window title that is an empty character */
found
=
FindWindowA
(
"Shell_TrayWnd"
,
""
);
ok
(
found
!=
NULL
,
"found is NULL, expected a valid hwnd
\n
"
);
found
=
FindWindowA
(
"Shell_TrayWnd"
,
NULL
);
ok
(
found
!=
NULL
,
"found is NULL, expected a valid hwnd
\n
"
);
}
static
void
test_GetLastActivePopup
(
void
)
{
HWND
hwndOwner
,
hwndPopup1
,
hwndPopup2
;
...
...
@@ -9500,6 +9566,7 @@ START_TEST(win)
/* make sure that these tests are executed first */
test_FindWindowEx
();
test_FindWindow
();
test_SetParent
();
hwndMain2
=
CreateWindowExA
(
/*WS_EX_TOOLWINDOW*/
0
,
"MainWindowClass"
,
"Main window 2"
,
...
...
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