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
7c60e623
Commit
7c60e623
authored
Jul 11, 2022
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Jul 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Add SHOpenFolderAndSelectItems() tests.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
parent
f6206bcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
0 deletions
+100
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+100
-0
No files found.
dlls/shell32/tests/shlfolder.c
View file @
7c60e623
...
...
@@ -81,6 +81,37 @@ static WCHAR *make_wstr(const char *str)
return
ret
;
}
static
BOOL
check_window_exists
(
const
char
*
name
)
{
HWND
window
=
NULL
;
int
i
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
if
((
window
=
FindWindowA
(
"ExplorerWClass"
,
name
))
||
(
window
=
FindWindowA
(
"CabinetWClass"
,
name
)))
{
SendMessageA
(
window
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
break
;
}
Sleep
(
100
);
}
if
(
!
window
)
return
FALSE
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
if
(
!
IsWindow
(
window
))
break
;
Sleep
(
100
);
}
return
TRUE
;
}
static
void
init_function_pointers
(
void
)
{
HMODULE
hmod
;
...
...
@@ -5410,6 +5441,74 @@ static void test_SHGetSetFolderCustomSettings(void)
RemoveDirectoryW
(
pathW
);
}
static
void
test_SHOpenFolderAndSelectItems
(
void
)
{
PIDLIST_ABSOLUTE
folder
,
items
[
2
];
HRESULT
hr
;
/* NULL folder */
hr
=
SHOpenFolderAndSelectItems
(
NULL
,
0
,
NULL
,
0
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* Open and select folder without child items */
folder
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
System32"
);
hr
=
SHOpenFolderAndSelectItems
(
folder
,
0
,
NULL
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
check_window_exists
(
"Windows"
),
"Failed to create window.
\n
"
);
ILFree
(
folder
);
/* Open folder and select one child item */
folder
=
ILCreateFromPathW
(
L"C:
\\
Windows"
);
items
[
0
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
System32"
);
hr
=
SHOpenFolderAndSelectItems
(
folder
,
1
,
(
PCUITEMID_CHILD_ARRAY
)
items
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
check_window_exists
(
"Windows"
),
"Failed to create window.
\n
"
);
ILFree
(
items
[
0
]);
ILFree
(
folder
);
/* Open folder and select two child items */
folder
=
ILCreateFromPathW
(
L"C:
\\
Windows"
);
items
[
0
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
System32"
);
items
[
1
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
Resources"
);
hr
=
SHOpenFolderAndSelectItems
(
folder
,
2
,
(
PCUITEMID_CHILD_ARRAY
)
items
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
check_window_exists
(
"Windows"
),
"Failed to create window.
\n
"
);
ILFree
(
items
[
1
]);
ILFree
(
items
[
0
]);
ILFree
(
folder
);
/* Open folder and select one child item with OFASI_EDIT */
folder
=
ILCreateFromPathW
(
L"C:
\\
Windows"
);
items
[
0
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
System32"
);
hr
=
SHOpenFolderAndSelectItems
(
folder
,
1
,
(
PCUITEMID_CHILD_ARRAY
)
items
,
OFASI_EDIT
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
check_window_exists
(
"Windows"
),
"Failed to create window.
\n
"
);
ILFree
(
items
[
0
]);
ILFree
(
folder
);
/* Open folder and select two child items and OFASI_EDIT */
folder
=
ILCreateFromPathW
(
L"C:
\\
Windows"
);
items
[
0
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
System32"
);
items
[
1
]
=
ILCreateFromPathW
(
L"C:
\\
Windows
\\
Resources"
);
hr
=
SHOpenFolderAndSelectItems
(
folder
,
2
,
(
PCUITEMID_CHILD_ARRAY
)
items
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
check_window_exists
(
"Windows"
),
"Failed to create window.
\n
"
);
ILFree
(
items
[
1
]);
ILFree
(
items
[
0
]);
ILFree
(
folder
);
}
START_TEST
(
shlfolder
)
{
init_function_pointers
();
...
...
@@ -5455,6 +5554,7 @@ START_TEST(shlfolder)
test_GetDefaultSearchGUID
();
test_SHLimitInputEdit
();
test_SHGetSetFolderCustomSettings
();
test_SHOpenFolderAndSelectItems
();
OleUninitialize
();
}
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