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
588e423b
Commit
588e423b
authored
Dec 28, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Add a simple test for XMLHTTP.
parent
0eb110f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+48
-0
No files found.
dlls/msxml3/tests/domdoc.c
View file @
588e423b
...
...
@@ -23,6 +23,7 @@
#include "windows.h"
#include "ole2.h"
#include "xmldom.h"
#include "msxml2.h"
#include <stdio.h>
...
...
@@ -1090,6 +1091,52 @@ static void test_removeChild(void)
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_XMLHTTP
(
void
)
{
static
const
WCHAR
wszBody
[]
=
{
'm'
,
'o'
,
'd'
,
'e'
,
'='
,
'T'
,
'e'
,
's'
,
't'
,
0
};
static
WCHAR
wszPOST
[]
=
{
'P'
,
'O'
,
'S'
,
'T'
,
0
};
static
WCHAR
wszUrl
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'c'
,
'r'
,
'o'
,
's'
,
's'
,
'o'
,
'v'
,
'e'
,
'r'
,
'.'
,
'c'
,
'o'
,
'd'
,
'e'
,
'w'
,
'e'
,
'a'
,
'v'
,
'e'
,
'r'
,
's'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'p'
,
'o'
,
's'
,
't'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'p'
,
'h'
,
'p'
,
0
};
static
const
WCHAR
wszExpectedResponse
[]
=
{
'F'
,
'A'
,
'I'
,
'L'
,
'E'
,
'D'
,
0
};
IXMLHttpRequest
*
pXMLHttpRequest
;
BSTR
bstrResponse
;
VARIANT
dummy
;
VARIANT
varfalse
;
VARIANT
varbody
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_XMLHTTPRequest
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLHttpRequest
,
(
void
**
)
&
pXMLHttpRequest
);
todo_wine
{
ok
(
hr
==
S_OK
,
"CoCreateInstance(CLSID_XMLHTTPRequest) should have succeeded instead of failing with 0x%08x
\n
"
,
hr
);
}
if
(
hr
!=
S_OK
)
return
;
VariantInit
(
&
dummy
);
V_VT
(
&
dummy
)
=
VT_ERROR
;
V_ERROR
(
&
dummy
)
=
DISP_E_MEMBERNOTFOUND
;
VariantInit
(
&
varfalse
);
V_VT
(
&
varfalse
)
=
VT_BOOL
;
V_BOOL
(
&
varfalse
)
=
VARIANT_FALSE
;
V_VT
(
&
varbody
)
=
VT_BSTR
;
V_BSTR
(
&
varbody
)
=
SysAllocString
(
wszBody
);
hr
=
IXMLHttpRequest_open
(
pXMLHttpRequest
,
wszPOST
,
wszUrl
,
varfalse
,
dummy
,
dummy
);
ok
(
hr
==
S_OK
,
"IXMLHttpRequest_open should have succeeded instead of failing with 0x%08x
\n
"
,
hr
);
hr
=
IXMLHttpRequest_send
(
pXMLHttpRequest
,
varbody
);
ok
(
hr
==
S_OK
,
"IXMLHttpRequest_send should have succeeded instead of failing with 0x%08x
\n
"
,
hr
);
VariantClear
(
&
varbody
);
hr
=
IXMLHttpRequest_get_responseText
(
pXMLHttpRequest
,
&
bstrResponse
);
ok
(
hr
==
S_OK
,
"IXMLHttpRequest_get_responseText should have succeeded instead of failing with 0x%08x
\n
"
,
hr
);
/* the server currently returns "FAILED" because the Content-Type header is
* not what the server expects */
ok
(
!
memcmp
(
bstrResponse
,
wszExpectedResponse
,
sizeof
(
wszExpectedResponse
)),
"bstrResponse differs from what was expected
\n
"
);
SysFreeString
(
bstrResponse
);
}
START_TEST
(
domdoc
)
{
HRESULT
r
;
...
...
@@ -1105,6 +1152,7 @@ START_TEST(domdoc)
test_get_text
();
test_get_childNodes
();
test_removeChild
();
test_XMLHTTP
();
CoUninitialize
();
}
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