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
5a5eddfe
Commit
5a5eddfe
authored
May 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added 204 No Content response tests.
parent
188de034
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
http.c
dlls/wininet/tests/http.c
+63
-0
No files found.
dlls/wininet/tests/http.c
View file @
5a5eddfe
...
...
@@ -1760,6 +1760,11 @@ static DWORD CALLBACK server_thread(LPVOID param)
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"GET /test_no_content"
))
{
static
const
char
nocontentmsg
[]
=
"HTTP/1.1 204 No Content
\r\n
Connection: close
\r\n\r\n
"
;
send
(
c
,
nocontentmsg
,
sizeof
(
nocontentmsg
)
-
1
,
0
);
}
shutdown
(
c
,
2
);
closesocket
(
c
);
...
...
@@ -2112,6 +2117,63 @@ static void test_http1_1(int port)
InternetCloseHandle
(
ses
);
}
static
void
test_no_content
(
int
port
)
{
HINTERNET
session
,
connection
,
req
;
DWORD
res
;
trace
(
"Testing 204 no content response...
\n
"
);
hCompleteEvent
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
session
=
InternetOpenA
(
""
,
INTERNET_OPEN_TYPE_PRECONFIG
,
NULL
,
NULL
,
INTERNET_FLAG_ASYNC
);
ok
(
session
!=
NULL
,
"InternetOpen failed with error %u
\n
"
,
GetLastError
());
pInternetSetStatusCallbackA
(
session
,
callback
);
SET_EXPECT
(
INTERNET_STATUS_HANDLE_CREATED
);
connection
=
InternetConnectA
(
session
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0x0
,
0xdeadbeef
);
ok
(
connection
!=
NULL
,
"InternetConnect failed with error %u
\n
"
,
GetLastError
());
CHECK_NOTIFIED
(
INTERNET_STATUS_HANDLE_CREATED
);
SET_EXPECT
(
INTERNET_STATUS_HANDLE_CREATED
);
req
=
HttpOpenRequestA
(
connection
,
"GET"
,
"/test_no_content"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
|
INTERNET_FLAG_RESYNCHRONIZE
,
0xdeadbead
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed: %u
\n
"
,
GetLastError
());
CHECK_NOTIFIED
(
INTERNET_STATUS_HANDLE_CREATED
);
SET_OPTIONAL
(
INTERNET_STATUS_COOKIE_SENT
);
SET_EXPECT
(
INTERNET_STATUS_CONNECTING_TO_SERVER
);
SET_EXPECT
(
INTERNET_STATUS_CONNECTED_TO_SERVER
);
SET_EXPECT
(
INTERNET_STATUS_SENDING_REQUEST
);
SET_EXPECT
(
INTERNET_STATUS_REQUEST_SENT
);
SET_EXPECT
(
INTERNET_STATUS_RECEIVING_RESPONSE
);
SET_EXPECT
(
INTERNET_STATUS_RESPONSE_RECEIVED
);
SET_EXPECT
(
INTERNET_STATUS_CLOSING_CONNECTION
);
SET_EXPECT
(
INTERNET_STATUS_CONNECTION_CLOSED
);
SET_EXPECT
(
INTERNET_STATUS_REQUEST_COMPLETE
);
res
=
HttpSendRequestA
(
req
,
NULL
,
-
1
,
NULL
,
0
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_IO_PENDING
),
"Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING
\n
"
);
WaitForSingleObject
(
hCompleteEvent
,
INFINITE
);
CLEAR_NOTIFIED
(
INTERNET_STATUS_COOKIE_SENT
);
CHECK_NOTIFIED
(
INTERNET_STATUS_CONNECTING_TO_SERVER
);
CHECK_NOTIFIED
(
INTERNET_STATUS_CONNECTED_TO_SERVER
);
CHECK_NOTIFIED
(
INTERNET_STATUS_SENDING_REQUEST
);
CHECK_NOTIFIED
(
INTERNET_STATUS_REQUEST_SENT
);
CHECK_NOTIFIED
(
INTERNET_STATUS_RECEIVING_RESPONSE
);
CHECK_NOTIFIED
(
INTERNET_STATUS_RESPONSE_RECEIVED
);
CHECK_NOTIFIED
(
INTERNET_STATUS_CLOSING_CONNECTION
);
CHECK_NOTIFIED
(
INTERNET_STATUS_CONNECTION_CLOSED
);
CHECK_NOTIFIED
(
INTERNET_STATUS_REQUEST_COMPLETE
);
close_async_handle
(
session
,
hCompleteEvent
,
2
);
CloseHandle
(
hCompleteEvent
);
}
static
void
test_HttpSendRequestW
(
int
port
)
{
static
const
WCHAR
header
[]
=
{
'U'
,
'A'
,
'-'
,
'C'
,
'P'
,
'U'
,
':'
,
' '
,
'x'
,
'8'
,
'6'
,
0
};
...
...
@@ -2645,6 +2707,7 @@ static void test_http_connection(void)
test_last_error
(
si
.
port
);
test_options
(
si
.
port
);
test_url_caching
(
si
.
port
,
&
si
.
num_testH_retrievals
);
test_no_content
(
si
.
port
);
/* send the basic request again to shutdown the server thread */
test_basic_request
(
si
.
port
,
"GET"
,
"/quit"
);
...
...
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