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
206bebfd
Commit
206bebfd
authored
Feb 24, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLXMLHttpRequest::getResponseHeader implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4361a1f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
xmlhttprequest.c
dlls/mshtml/tests/xmlhttprequest.c
+17
-0
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+29
-2
No files found.
dlls/mshtml/tests/xmlhttprequest.c
View file @
206bebfd
...
...
@@ -524,6 +524,19 @@ static void test_illegal_xml(IXMLDOMDocument *xmldom)
ok
(
last
==
NULL
,
"last != NULL
\n
"
);
}
#define set_request_header(a,b,c) _set_request_header(__LINE__,a,b,c)
static
void
_set_request_header
(
unsigned
line
,
IHTMLXMLHttpRequest
*
xhr
,
const
char
*
header_a
,
const
char
*
value_a
)
{
BSTR
header
=
a2bstr
(
header_a
),
value
=
a2bstr
(
value_a
);
HRESULT
hres
;
hres
=
IHTMLXMLHttpRequest_setRequestHeader
(
xhr
,
header
,
value
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"setRequestHeader failed: %08x
\n
"
,
hres
);
SysFreeString
(
header
);
SysFreeString
(
value
);
}
static
void
test_responseXML
(
const
char
*
expect_text
)
{
IDispatch
*
disp
;
...
...
@@ -673,6 +686,8 @@ static void test_sync_xhr(IHTMLDocument2 *doc, const char *xml_url, const char *
ok
(
hres
==
S_OK
,
"get_readyState failed: %08x
\n
"
,
hres
);
ok
(
val
==
1
,
"Expect OPENED, got %d
\n
"
,
val
);
set_request_header
(
xhr
,
"x-wine-test"
,
"sync-test"
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_opened
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_headers_received
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_loading
);
...
...
@@ -835,6 +850,8 @@ static void test_async_xhr(IHTMLDocument2 *doc, const char *xml_url, const char
ok
(
hres
==
S_OK
,
"get_readyState failed: %08x
\n
"
,
hres
);
ok
(
val
==
1
,
"Expect OPENED, got %d
\n
"
,
val
);
set_request_header
(
xhr
,
"x-wine-test"
,
"async-test"
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_opened
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_headers_received
);
SET_EXPECT
(
xmlhttprequest_onreadystatechange_loading
);
...
...
dlls/mshtml/xmlhttprequest.c
View file @
206bebfd
...
...
@@ -613,8 +613,35 @@ static HRESULT WINAPI HTMLXMLHttpRequest_getResponseHeader(IHTMLXMLHttpRequest *
static
HRESULT
WINAPI
HTMLXMLHttpRequest_setRequestHeader
(
IHTMLXMLHttpRequest
*
iface
,
BSTR
bstrHeader
,
BSTR
bstrValue
)
{
HTMLXMLHttpRequest
*
This
=
impl_from_IHTMLXMLHttpRequest
(
iface
);
FIXME
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
bstrHeader
),
debugstr_w
(
bstrValue
));
return
E_NOTIMPL
;
char
*
header_u
,
*
value_u
;
nsACString
header
,
value
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
bstrHeader
),
debugstr_w
(
bstrValue
));
header_u
=
heap_strdupWtoU
(
bstrHeader
);
if
(
bstrHeader
&&
!
header_u
)
return
E_OUTOFMEMORY
;
value_u
=
heap_strdupWtoU
(
bstrValue
);
if
(
bstrValue
&&
!
value_u
)
{
heap_free
(
header_u
);
return
E_OUTOFMEMORY
;
}
nsACString_InitDepend
(
&
header
,
header_u
);
nsACString_InitDepend
(
&
value
,
value_u
);
nsres
=
nsIXMLHttpRequest_SetRequestHeader
(
This
->
nsxhr
,
&
header
,
&
value
);
nsACString_Finish
(
&
header
);
nsACString_Finish
(
&
value
);
heap_free
(
header_u
);
heap_free
(
value_u
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"SetRequestHeader failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
static
const
IHTMLXMLHttpRequestVtbl
HTMLXMLHttpRequestVtbl
=
{
...
...
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