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
10a3dbbd
Commit
10a3dbbd
authored
Nov 25, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorerframe/tests: Add ITaskbarList tests.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3c789e2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
187 additions
and
1 deletion
+187
-1
Makefile.in
dlls/explorerframe/tests/Makefile.in
+2
-1
taskbarlist.c
dlls/explorerframe/tests/taskbarlist.c
+185
-0
No files found.
dlls/explorerframe/tests/Makefile.in
View file @
10a3dbbd
...
...
@@ -2,4 +2,5 @@ TESTDLL = explorerframe.dll
IMPORTS
=
uuid shell32 ole32 user32
C_SRCS
=
\
nstc.c
nstc.c
\
taskbarlist.c
dlls/explorerframe/tests/taskbarlist.c
0 → 100644
View file @
10a3dbbd
/*
* Unit tests for ITaskbarList interface
*
* Copyright 2021 Zhiyi Zhang for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <shobjidl.h>
#include <wine/test.h>
static
void
test_ITaskbarList
(
void
)
{
ITaskbarList
*
taskbarlist
;
ULONG
ref_count
;
HRESULT
hr
;
HWND
hwnd
;
hwnd
=
CreateWindowA
(
WC_STATICA
,
"test"
,
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
50
,
50
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
NULL
,
"Failed to create a test window, error %u.
\n
"
,
GetLastError
());
hr
=
CoCreateInstance
((
const
CLSID
*
)
&
CLSID_TaskbarList
,
NULL
,
CLSCTX_INPROC_SERVER
,
(
const
IID
*
)
&
IID_ITaskbarList
,
(
void
**
)
&
taskbarlist
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref_count
=
ITaskbarList_AddRef
(
taskbarlist
);
ok
(
ref_count
==
2
,
"Got unexpected reference count %u.
\n
"
,
ref_count
);
ref_count
=
ITaskbarList_Release
(
taskbarlist
);
ok
(
ref_count
==
1
,
"Got unexpected reference count %u.
\n
"
,
ref_count
);
/* Test calling methods before calling ITaskbarList::HrInit() */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_SetActiveAlt
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_ActivateTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Call ITaskbarList::HrInit() */
hr
=
ITaskbarList_HrInit
(
taskbarlist
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Test ITaskbarList::HrInit() */
/* Call ITaskbarList::HrInit() again */
hr
=
ITaskbarList_HrInit
(
taskbarlist
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Test ITaskbarList::AddTab() */
/* Check invalid parameters */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
(
HWND
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Normal ITaskbarList::AddTab() */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Repeat ITaskbarList::AddTab() with the same hwnd */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Test ITaskbarList::SetActiveAlt() */
/* Check invalid parameters */
hr
=
ITaskbarList_SetActiveAlt
(
taskbarlist
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_SetActiveAlt
(
taskbarlist
,
(
HWND
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Normal ITaskbarList::SetActiveAlt() */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_SetActiveAlt
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Repeat ITaskbarList::SetActiveAlt() with the same hwnd */
hr
=
ITaskbarList_SetActiveAlt
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Test ITaskbarList::ActivateTab() */
/* Check invalid parameters */
hr
=
ITaskbarList_ActivateTab
(
taskbarlist
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_ActivateTab
(
taskbarlist
,
(
HWND
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Normal ITaskbarList::ActivateTab() */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_ActivateTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Repeat ITaskbarList::ActivateTab() with the same hwnd */
hr
=
ITaskbarList_ActivateTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Test ITaskbarList::DeleteTab() */
/* Check invalid parameters */
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
(
HWND
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Normal ITaskbarList::DeleteTab() */
hr
=
ITaskbarList_AddTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
ITaskbarList_DeleteTab
(
taskbarlist
,
hwnd
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref_count
=
ITaskbarList_Release
(
taskbarlist
);
ok
(
ref_count
==
0
,
"Got unexpected reference count %u.
\n
"
,
ref_count
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
taskbarlist
)
{
CoInitialize
(
NULL
);
test_ITaskbarList
();
CoUninitialize
();
}
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