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
46aba956
Commit
46aba956
authored
Nov 30, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink/tests: Add tests for navigating from a string reference.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f39c6c3c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
12 deletions
+67
-12
hlink.c
dlls/hlink/tests/hlink.c
+67
-12
No files found.
dlls/hlink/tests/hlink.c
View file @
46aba956
...
...
@@ -67,6 +67,9 @@ DEFINE_EXPECT(GetClassID);
DEFINE_EXPECT
(
Save
);
DEFINE_EXPECT
(
HBC_QueryInterface_IHlinkHistory
);
DEFINE_EXPECT
(
HBC_QueryInterface_IMarshal
);
DEFINE_EXPECT
(
HBC_QueryInterface_IdentityUnmarshal
);
DEFINE_EXPECT
(
HBC_QueryInterface_IUnknown
);
DEFINE_EXPECT
(
HBC_GetObject
);
DEFINE_EXPECT
(
HBC_UpdateHlink
);
...
...
@@ -77,8 +80,16 @@ DEFINE_EXPECT(HT_GetFriendlyName);
DEFINE_EXPECT
(
HLF_UpdateHlink
);
DEFINE_GUID
(
CLSID_IdentityUnmarshal
,
0x0000001b
,
0x0000
,
0x0000
,
0xc0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
DEFINE_GUID
(
IID_IHlinkHistory
,
0x79eac9c8
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
static
const
WCHAR
winehq_urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
't'
,
'e'
,
's'
,
't'
,
's'
,
'/'
,
'h'
,
'e'
,
'l'
,
'l'
,
'o'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
winehq_404W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
't'
,
'e'
,
's'
,
't'
,
's'
,
'/'
,
'f'
,
'a'
,
'k'
,
'e'
,
'u'
,
'r'
,
'l'
,
0
};
static
void
test_HlinkIsShortcut
(
void
)
{
UINT
i
;
...
...
@@ -627,9 +638,6 @@ static void test_HlinkParseDisplayName(void)
IBindCtx
*
bctx
;
HRESULT
hres
;
static
const
WCHAR
winehq_urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
0
};
static
const
WCHAR
invalid_urlW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
':'
,
'1'
,
'2'
,
'3'
,
'a'
,
'b'
,
'c'
,
0
};
static
const
WCHAR
clsid_nameW
[]
=
{
'c'
,
'l'
,
's'
,
'i'
,
'd'
,
':'
,
'2'
,
'0'
,
'D'
,
'0'
,
'4'
,
'F'
,
'E'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
'A'
,
'2'
,
'D'
,
'8'
,
...
...
@@ -829,12 +837,17 @@ static HRESULT WINAPI HlinkBrowseContext_QueryInterface(
{
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IHlinkHistory
,
riid
))
{
if
(
IsEqualGUID
(
&
IID_IHlinkHistory
,
riid
))
CHECK_EXPECT
(
HBC_QueryInterface_IHlinkHistory
);
return
E_NOINTERFACE
;
}
else
if
(
IsEqualGUID
(
&
IID_IMarshal
,
riid
))
CHECK_EXPECT2
(
HBC_QueryInterface_IMarshal
);
else
if
(
IsEqualGUID
(
&
CLSID_IdentityUnmarshal
,
riid
))
CHECK_EXPECT
(
HBC_QueryInterface_IdentityUnmarshal
);
else
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
CHECK_EXPECT
(
HBC_QueryInterface_IUnknown
);
else
ok
(
0
,
"unexpected interface: %s
\n
"
,
wine_dbgstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
...
...
@@ -859,9 +872,17 @@ static IMoniker Moniker;
static
HRESULT
WINAPI
HlinkBrowseContext_GetObject
(
IHlinkBrowseContext
*
iface
,
IMoniker
*
pimk
,
BOOL
fBindIfRootRegistered
,
IUnknown
**
ppiunk
)
{
IBindCtx
*
bctx
;
WCHAR
*
name
;
CHECK_EXPECT
(
HBC_GetObject
);
ok
(
pimk
==
&
Moniker
,
"pimk != &Moniker
\n
"
);
CreateBindCtx
(
0
,
&
bctx
);
IMoniker_GetDisplayName
(
pimk
,
bctx
,
NULL
,
&
name
);
ok
(
!
lstrcmpW
(
winehq_urlW
,
name
)
||
!
lstrcmpW
(
winehq_404W
,
name
),
"got unexpected url
\n
"
);
CoTaskMemFree
(
name
);
IBindCtx_Release
(
bctx
);
ok
(
fBindIfRootRegistered
==
1
,
"fBindIfRootRegistered = %x
\n
"
,
fBindIfRootRegistered
);
*
ppiunk
=
NULL
;
return
S_FALSE
;
...
...
@@ -1205,10 +1226,6 @@ static HRESULT WINAPI Moniker_RelativePathTo(IMoniker *iface, IMoniker *pmkOther
static
HRESULT
WINAPI
Moniker_GetDisplayName
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
LPOLESTR
*
ppszDisplayName
)
{
static
const
WCHAR
winehq_urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
0
};
CHECK_EXPECT2
(
GetDisplayName
);
ok
(
pbc
!=
NULL
,
"pbc == NULL
\n
"
);
...
...
@@ -2206,6 +2223,44 @@ static void test_Hlink_Navigate(void)
CHECK_CALLED
(
HT_Navigate
);
todo_wine
CHECK_CALLED
(
HT_GetFriendlyName
);
if
(
0
)
{
/* these currently open a browser window on wine */
/* Test from string */
SET_EXPECT
(
HBC_GetObject
);
hres
=
HlinkNavigateToStringReference
(
winehq_404W
,
NULL
,
NULL
,
0
,
NULL
,
0
,
pbc
,
NULL
,
&
HlinkBrowseContext
);
todo_wine
ok
(
hres
==
INET_E_OBJECT_NOT_FOUND
,
"Expected INET_E_OBJECT_NOT_FOUND, got %08x
\n
"
,
hres
);
todo_wine
CHECK_CALLED
(
HBC_GetObject
);
/* MSDN claims browse context and bind context can't be null, but they can */
SET_EXPECT
(
HBC_GetObject
);
hres
=
HlinkNavigateToStringReference
(
winehq_404W
,
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
NULL
,
&
HlinkBrowseContext
);
todo_wine
ok
(
hres
==
INET_E_OBJECT_NOT_FOUND
,
"Expected INET_E_OBJECT_NOT_FOUND, got %08x
\n
"
,
hres
);
todo_wine
CHECK_CALLED
(
HBC_GetObject
);
}
/* these open a browser window, so mark them interactive only */
if
(
winetest_interactive
)
{
/* both parameters null */
hres
=
HlinkNavigateToStringReference
(
winehq_404W
,
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
hres
==
DRAGDROP_S_DROP
,
"Expected DRAGDROP_S_DROP, got %08x
\n
"
,
hres
);
/* try basic test with valid URL */
SET_EXPECT
(
HBC_GetObject
);
SET_EXPECT
(
HBC_QueryInterface_IHlinkHistory
);
SET_EXPECT
(
HBC_QueryInterface_IMarshal
);
SET_EXPECT
(
HBC_QueryInterface_IdentityUnmarshal
);
SET_EXPECT
(
HBC_QueryInterface_IUnknown
);
hres
=
HlinkNavigateToStringReference
(
winehq_urlW
,
NULL
,
NULL
,
0
,
NULL
,
0
,
pbc
,
NULL
,
&
HlinkBrowseContext
);
ok
(
hres
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hres
);
todo_wine
CHECK_CALLED
(
HBC_GetObject
);
todo_wine
CHECK_CALLED
(
HBC_QueryInterface_IHlinkHistory
);
todo_wine
CHECK_CALLED
(
HBC_QueryInterface_IMarshal
);
todo_wine
CHECK_CALLED
(
HBC_QueryInterface_IdentityUnmarshal
);
todo_wine
CHECK_CALLED
(
HBC_QueryInterface_IUnknown
);
}
else
skip
(
"interactive IHlink_Navigate tests
\n
"
);
IHlink_Release
(
hlink
);
IBindCtx_Release
(
pbc
);
_bctx
=
NULL
;
...
...
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