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
74d07b7b
Commit
74d07b7b
authored
Aug 05, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Aug 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLXMLHttpRequest::statusText property implementation.
parent
961f4c0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
12 deletions
+61
-12
xmlhttprequest.c
dlls/mshtml/tests/xmlhttprequest.c
+10
-10
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+51
-2
No files found.
dlls/mshtml/tests/xmlhttprequest.c
View file @
74d07b7b
...
...
@@ -457,11 +457,11 @@ static void test_sync_xhr(IHTMLDocument2 *doc, const char *xml_url)
ok
(
val
==
0
,
"Expect 0, got %d
\n
"
,
val
);
hres
=
IHTMLXMLHttpRequest_get_statusText
(
xhr
,
NULL
);
todo_wine
ok
(
hres
==
E_POINTER
,
"Expect E_POINTER, got %08x
\n
"
,
hres
);
ok
(
hres
==
E_POINTER
,
"Expect E_POINTER, got %08x
\n
"
,
hres
);
hres
=
IHTMLXMLHttpRequest_get_statusText
(
xhr
,
&
text
);
todo_wine
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
todo_wine
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
method
=
a2bstr
(
"GET"
);
url
=
a2bstr
(
xml_url
);
...
...
@@ -566,8 +566,8 @@ static void test_async_xhr(IHTMLDocument2 *doc, const char *xml_url)
text
=
(
BSTR
)
0xdeadbeef
;
hres
=
IHTMLXMLHttpRequest_get_statusText
(
xhr
,
&
text
);
todo_wine
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
todo_wine
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
val
=
0xdeadbeef
;
hres
=
IHTMLXMLHttpRequest_get_readyState
(
xhr
,
&
val
);
...
...
@@ -600,8 +600,8 @@ static void test_async_xhr(IHTMLDocument2 *doc, const char *xml_url)
ok
(
val
==
0
,
"Expect 0, got %d
\n
"
,
val
);
hres
=
IHTMLXMLHttpRequest_get_statusText
(
xhr
,
&
text
);
todo_wine
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
todo_wine
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
ok
(
hres
==
E_FAIL
,
"Expect E_FAIL, got: %08x
\n
"
,
hres
);
ok
(
text
==
NULL
,
"Expect NULL, got %p
\n
"
,
text
);
val
=
0xdeadbeef
;
hres
=
IHTMLXMLHttpRequest_get_readyState
(
xhr
,
&
val
);
...
...
@@ -635,9 +635,9 @@ static void test_async_xhr(IHTMLDocument2 *doc, const char *xml_url)
text
=
NULL
;
hres
=
IHTMLXMLHttpRequest_get_statusText
(
xhr
,
&
text
);
todo_wine
ok
(
hres
==
S_OK
,
"get_statusText failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
text
!=
NULL
,
"text == NULL
\n
"
);
todo_wine
ok
(
!
strcmp_wa
(
text
,
"OK"
),
"Expected
\"
OK
\"
, got %s
\n
"
,
wine_dbgstr_w
(
text
));
ok
(
hres
==
S_OK
,
"get_statusText failed: %08x
\n
"
,
hres
);
ok
(
text
!=
NULL
,
"text == NULL
\n
"
);
ok
(
!
strcmp_wa
(
text
,
"OK"
),
"Expected
\"
OK
\"
, got %s
\n
"
,
wine_dbgstr_w
(
text
));
SysFreeString
(
text
);
val
=
0xdeadbeef
;
...
...
dlls/mshtml/xmlhttprequest.c
View file @
74d07b7b
...
...
@@ -60,6 +60,35 @@ static HRESULT variant_to_nsastr(VARIANT var, nsAString *ret)
}
}
static
HRESULT
return_nscstr
(
nsresult
nsres
,
nsACString
*
nscstr
,
BSTR
*
p
)
{
const
char
*
str
;
int
len
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed: %08x
\n
"
,
nsres
);
nsACString_Finish
(
nscstr
);
return
E_FAIL
;
}
nsACString_GetData
(
nscstr
,
&
str
);
if
(
*
str
)
{
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
);
*
p
=
SysAllocStringLen
(
NULL
,
len
);
if
(
!*
p
)
{
nsACString_Finish
(
nscstr
);
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
*
p
,
len
);
}
else
{
*
p
=
NULL
;
}
nsACString_Finish
(
nscstr
);
return
S_OK
;
}
typedef
struct
XMLHttpReqEventListener
XMLHttpReqEventListener
;
typedef
struct
{
...
...
@@ -334,8 +363,28 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_status(IHTMLXMLHttpRequest *iface,
static
HRESULT
WINAPI
HTMLXMLHttpRequest_get_statusText
(
IHTMLXMLHttpRequest
*
iface
,
BSTR
*
p
)
{
HTMLXMLHttpRequest
*
This
=
impl_from_IHTMLXMLHttpRequest
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsACString
nscstr
;
nsresult
nsres
;
HRESULT
hres
;
LONG
state
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
p
)
return
E_POINTER
;
hres
=
IHTMLXMLHttpRequest_get_readyState
(
iface
,
&
state
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
state
<
2
)
{
*
p
=
NULL
;
return
E_FAIL
;
}
nsACString_Init
(
&
nscstr
,
NULL
);
nsres
=
nsIXMLHttpRequest_GetStatusText
(
This
->
nsxhr
,
&
nscstr
);
return
return_nscstr
(
nsres
,
&
nscstr
,
p
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequest_put_onreadystatechange
(
IHTMLXMLHttpRequest
*
iface
,
VARIANT
v
)
...
...
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