wininet: Fixed http tests on win10.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f6714f3832
commit
f4e68eef37
|
@ -520,7 +520,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test)
|
||||||
length = sizeof(buffer);
|
length = sizeof(buffer);
|
||||||
res = HttpQueryInfoA(hor, HTTP_QUERY_RAW_HEADERS, buffer, &length, 0x0);
|
res = HttpQueryInfoA(hor, HTTP_QUERY_RAW_HEADERS, buffer, &length, 0x0);
|
||||||
ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError());
|
ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError());
|
||||||
ok(length == 0, "HTTP_QUERY_RAW_HEADERS: expected length 0, but got %d\n", length);
|
ok(length == 0 || (length == 1 && !*buffer) /* win10 */, "HTTP_QUERY_RAW_HEADERS: expected length 0, but got %d\n", length);
|
||||||
ok(!strcmp(buffer, ""), "HTTP_QUERY_RAW_HEADERS: expected string \"\", but got \"%s\"\n", buffer);
|
ok(!strcmp(buffer, ""), "HTTP_QUERY_RAW_HEADERS: expected string \"\", but got \"%s\"\n", buffer);
|
||||||
|
|
||||||
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED);
|
||||||
|
@ -1759,8 +1759,8 @@ static void HttpHeaders_test(void)
|
||||||
memset(buffer, 'x', sizeof(buffer));
|
memset(buffer, 'x', sizeof(buffer));
|
||||||
ok(HttpQueryInfoA(hRequest,HTTP_QUERY_RAW_HEADERS_CRLF,
|
ok(HttpQueryInfoA(hRequest,HTTP_QUERY_RAW_HEADERS_CRLF,
|
||||||
buffer,&len,&index) == TRUE,"Query failed\n");
|
buffer,&len,&index) == TRUE,"Query failed\n");
|
||||||
ok(len == 2, "Expected 2, got %d\n", len);
|
ok(len == 2 || len == 4 /* win10 */, "Expected 2 or 4, got %d\n", len);
|
||||||
ok(strcmp(buffer, "\r\n") == 0, "Expected CRLF, got '%s'\n", buffer);
|
ok(memcmp(buffer, "\r\n\r\n", len) == 0, "Expected CRLF, got '%s'\n", buffer);
|
||||||
ok(index == 0, "Index was incremented\n");
|
ok(index == 0, "Index was incremented\n");
|
||||||
|
|
||||||
ok(HttpAddRequestHeadersA(hRequest,"Warning:test2",-1,HTTP_ADDREQ_FLAG_ADD),
|
ok(HttpAddRequestHeadersA(hRequest,"Warning:test2",-1,HTTP_ADDREQ_FLAG_ADD),
|
||||||
|
@ -1962,8 +1962,7 @@ static const char contmsg[] =
|
||||||
static const char expandcontmsg[] =
|
static const char expandcontmsg[] =
|
||||||
"HTTP/1.1 100 Continue\r\n"
|
"HTTP/1.1 100 Continue\r\n"
|
||||||
"Server: winecontinue\r\n"
|
"Server: winecontinue\r\n"
|
||||||
"Tag: something witty\r\n"
|
"Tag: something witty\r\n";
|
||||||
"\r\n";
|
|
||||||
|
|
||||||
static const char okmsg[] =
|
static const char okmsg[] =
|
||||||
"HTTP/1.1 200 OK\r\n"
|
"HTTP/1.1 200 OK\r\n"
|
||||||
|
@ -2390,6 +2389,8 @@ static void test_basic_request(int port, const char *verb, const char *url)
|
||||||
DWORD r, count, error;
|
DWORD r, count, error;
|
||||||
char buffer[0x100];
|
char buffer[0x100];
|
||||||
|
|
||||||
|
trace("basic request %s %s\n", verb, url);
|
||||||
|
|
||||||
hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
|
||||||
ok(hi != NULL, "open failed\n");
|
ok(hi != NULL, "open failed\n");
|
||||||
|
|
||||||
|
@ -2403,7 +2404,7 @@ static void test_basic_request(int port, const char *verb, const char *url)
|
||||||
r = HttpSendRequestA(hr, NULL, 0, NULL, 0);
|
r = HttpSendRequestA(hr, NULL, 0, NULL, 0);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error);
|
ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error);
|
||||||
ok(r, "HttpSendRequest failed\n");
|
ok(r, "HttpSendRequest failed: %u\n", GetLastError());
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
memset(buffer, 0, sizeof buffer);
|
memset(buffer, 0, sizeof buffer);
|
||||||
|
@ -3073,14 +3074,24 @@ static void test_header_override(int port)
|
||||||
ok(req != NULL, "HttpOpenRequest failed\n");
|
ok(req != NULL, "HttpOpenRequest failed\n");
|
||||||
|
|
||||||
ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE);
|
ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_REPLACE);
|
||||||
err = GetLastError();
|
if(ret) { /* win10 returns success */
|
||||||
todo_wine ok(!ret, "HttpAddRequestHeaders succeeded\n");
|
trace("replacing host header is supported.\n");
|
||||||
todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err);
|
|
||||||
|
|
||||||
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||||
ok(ret, "HttpSendRequest failed\n");
|
ok(ret, "HttpSendRequest failed\n");
|
||||||
|
|
||||||
test_status_code_todo(req, 400);
|
test_status_code(req, 200);
|
||||||
|
}else {
|
||||||
|
trace("replacing host header is not supported.\n");
|
||||||
|
|
||||||
|
err = GetLastError();
|
||||||
|
ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err);
|
||||||
|
|
||||||
|
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
|
||||||
|
ok(ret, "HttpSendRequest failed\n");
|
||||||
|
|
||||||
|
test_status_code(req, 400);
|
||||||
|
}
|
||||||
|
|
||||||
InternetCloseHandle(req);
|
InternetCloseHandle(req);
|
||||||
InternetCloseHandle(con);
|
InternetCloseHandle(con);
|
||||||
|
|
Loading…
Reference in New Issue