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
319a748f
Commit
319a748f
authored
Mar 28, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added IWinInetHttpInfo tests.
parent
1041f61e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
url.c
dlls/urlmon/tests/url.c
+48
-2
No files found.
dlls/urlmon/tests/url.c
View file @
319a748f
...
...
@@ -1352,6 +1352,51 @@ static IServiceProvider ServiceProvider = { &ServiceProviderVtbl };
static
IBindStatusCallbackEx
objbsc
;
static
void
test_WinInetHttpInfo
(
IWinInetHttpInfo
*
http_info
,
DWORD
progress
)
{
DWORD
status
,
size
;
HRESULT
hres
,
expect
;
/* QueryInfo changes it's behavior during this request */
if
(
progress
==
BINDSTATUS_SENDINGREQUEST
)
return
;
if
(
test_protocol
==
FTP_TEST
&&
download_state
==
BEFORE_DOWNLOAD
&&
progress
!=
BINDSTATUS_MIMETYPEAVAILABLE
)
expect
=
E_FAIL
;
else
if
(
test_protocol
==
FTP_TEST
)
expect
=
S_FALSE
;
else
expect
=
S_OK
;
size
=
sizeof
(
DWORD
);
hres
=
IWinInetHttpInfo_QueryInfo
(
http_info
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
,
NULL
);
ok
(
hres
==
expect
,
"hres = %x, expected %x
\n
"
,
hres
,
expect
);
if
(
hres
==
S_OK
)
{
if
(
download_state
==
BEFORE_DOWNLOAD
&&
progress
!=
BINDSTATUS_MIMETYPEAVAILABLE
)
ok
(
status
==
0
,
"status = %d
\n
"
,
status
);
else
ok
(
status
==
HTTP_STATUS_OK
,
"status = %d
\n
"
,
status
);
ok
(
size
==
sizeof
(
DWORD
),
"size = %d
\n
"
,
size
);
}
size
=
sizeof
(
DWORD
);
hres
=
IWinInetHttpInfo_QueryOption
(
http_info
,
INTERNET_OPTION_HANDLE_TYPE
,
&
status
,
&
size
);
if
(
test_protocol
==
FTP_TEST
)
{
if
(
download_state
==
BEFORE_DOWNLOAD
&&
progress
!=
BINDSTATUS_MIMETYPEAVAILABLE
)
ok
(
hres
==
E_FAIL
,
"hres = %x
\n
"
,
hres
);
else
ok
(
hres
==
S_OK
,
"hres = %x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
ok
(
status
==
INTERNET_HANDLE_TYPE_FTP_FILE
,
"status = %d
\n
"
,
status
);
}
else
{
ok
(
hres
==
S_OK
,
"hres = %x
\n
"
,
hres
);
ok
(
status
==
INTERNET_HANDLE_TYPE_HTTP_REQUEST
,
"status = %d
\n
"
,
status
);
}
}
static
HRESULT
WINAPI
statusclb_QueryInterface
(
IBindStatusCallbackEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ok
(
GetCurrentThreadId
()
==
thread_id
,
"wrong thread %d
\n
"
,
GetCurrentThreadId
());
...
...
@@ -1658,9 +1703,10 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u
HRESULT
hres
;
hres
=
IBinding_QueryInterface
(
current_binding
,
&
IID_IWinInetHttpInfo
,
(
void
**
)
&
http_info
);
if
(
!
emulate_protocol
&&
test_protocol
!=
FILE_TEST
&&
is_urlmon_protocol
(
test_protocol
))
if
(
!
emulate_protocol
&&
test_protocol
!=
FILE_TEST
&&
is_urlmon_protocol
(
test_protocol
))
{
ok
(
hres
==
S_OK
,
"Could not get IWinInetHttpInfo iface: %08x
\n
"
,
hres
);
else
test_WinInetHttpInfo
(
http_info
,
ulStatusCode
);
}
else
ok
(
hres
==
E_NOINTERFACE
,
"QueryInterface(IID_IWinInetHttpInfo) returned: %08x, expected E_NOINTERFACE
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
...
...
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