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
f46868fe
Commit
f46868fe
authored
Aug 27, 2015
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp/tests: Add a test for IWinHttpRequest::Invoke.
parent
60b996ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
1 deletion
+70
-1
winhttp.c
dlls/winhttp/tests/winhttp.c
+70
-1
No files found.
dlls/winhttp/tests/winhttp.c
View file @
f46868fe
...
...
@@ -26,11 +26,14 @@
#include <winhttp.h>
#include <wincrypt.h>
#include <winreg.h>
#include
"initguid.h"
#include
<initguid.h>
#include <httprequest.h>
#include <httprequestid.h>
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
const
WCHAR
test_useragent
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'R'
,
'e'
,
'g'
,
'r'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
' '
,
'T'
,
'e'
,
's'
,
't'
,
0
};
static
const
WCHAR
test_winehq
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
...
...
@@ -3539,6 +3542,71 @@ static void test_IWinHttpRequest(void)
CoUninitialize
();
}
static
void
test_IWinHttpRequest_Invoke
(
void
)
{
static
const
WCHAR
utf8W
[]
=
{
'U'
,
'T'
,
'F'
,
'-'
,
'8'
,
0
};
static
const
WCHAR
regid
[]
=
{
'W'
,
'i'
,
'n'
,
'H'
,
't'
,
't'
,
'p'
,
'.'
,
'W'
,
'i'
,
'n'
,
'H'
,
't'
,
't'
,
'p'
,
'R'
,
'e'
,
'q'
,
'u'
,
'e'
,
's'
,
't'
,
'.'
,
'5'
,
'.'
,
'1'
,
0
};
WCHAR
openW
[]
=
{
'O'
,
'p'
,
'e'
,
'n'
,
0
};
WCHAR
optionW
[]
=
{
'O'
,
'p'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
OLECHAR
*
open
=
openW
,
*
option
=
optionW
;
BSTR
utf8
;
CLSID
clsid
;
IWinHttpRequest
*
request
;
IDispatch
*
dispatch
;
DISPID
id
;
DISPPARAMS
params
;
VARIANT
arg
[
3
],
ret
;
UINT
err
;
BOOL
bret
;
HRESULT
hr
;
CoInitialize
(
NULL
);
hr
=
CLSIDFromProgID
(
regid
,
&
clsid
);
ok
(
hr
==
S_OK
,
"CLSIDFromProgID error %#x
\n
"
,
hr
);
bret
=
IsEqualIID
(
&
clsid
,
&
CLSID_WinHttpRequest
);
ok
(
bret
||
broken
(
!
bret
)
/* win2003 */
,
"not expected %s
\n
"
,
wine_dbgstr_guid
(
&
clsid
));
hr
=
CoCreateInstance
(
&
CLSID_WinHttpRequest
,
0
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
request
);
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
hr
=
IWinHttpRequest_QueryInterface
(
request
,
&
IID_IDispatch
,
(
void
**
)
&
dispatch
);
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
IDispatch_Release
(
dispatch
);
hr
=
IWinHttpRequest_GetIDsOfNames
(
request
,
&
IID_NULL
,
&
open
,
1
,
0x0409
,
&
id
);
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
ok
(
id
==
DISPID_HTTPREQUEST_OPEN
,
"expected DISPID_HTTPREQUEST_OPEN, got %u
\n
"
,
id
);
hr
=
IWinHttpRequest_GetIDsOfNames
(
request
,
&
IID_NULL
,
&
option
,
1
,
0x0409
,
&
id
);
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
ok
(
id
==
DISPID_HTTPREQUEST_OPTION
,
"expected DISPID_HTTPREQUEST_OPTION, got %u
\n
"
,
id
);
memset
(
&
params
,
0
,
sizeof
(
params
));
params
.
cArgs
=
2
;
params
.
cNamedArgs
=
0
;
params
.
rgvarg
=
arg
;
V_VT
(
&
arg
[
0
])
=
VT_BSTR
;
utf8
=
SysAllocString
(
utf8W
);
V_BSTR
(
&
arg
[
0
])
=
utf8
;
V_VT
(
&
arg
[
1
])
=
VT_R8
;
V_R8
(
&
arg
[
1
])
=
2
.
0
;
VariantInit
(
&
ret
);
hr
=
IWinHttpRequest_Invoke
(
request
,
id
,
&
IID_NULL
,
0
,
DISPATCH_METHOD
,
&
params
,
NULL
,
NULL
,
&
err
);
todo_wine
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
VariantInit
(
&
ret
);
hr
=
IWinHttpRequest_Invoke
(
request
,
id
,
&
IID_NULL
,
0
,
DISPATCH_METHOD
,
&
params
,
&
ret
,
NULL
,
&
err
);
todo_wine
ok
(
hr
==
S_OK
,
"error %#x
\n
"
,
hr
);
SysFreeString
(
utf8
);
IWinHttpRequest_Release
(
request
);
CoUninitialize
();
}
static
void
test_WinHttpDetectAutoProxyConfigUrl
(
void
)
{
BOOL
ret
;
...
...
@@ -3839,6 +3907,7 @@ START_TEST (winhttp)
test_resolve_timeout
();
test_credentials
();
test_IWinHttpRequest
();
test_IWinHttpRequest_Invoke
();
test_WinHttpDetectAutoProxyConfigUrl
();
test_WinHttpGetIEProxyConfigForCurrentUser
();
test_WinHttpGetProxyForUrl
();
...
...
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