winhttp/tests: Make notification tests more strict.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-07-11 15:09:17 +02:00 committed by Alexandre Julliard
parent 32334704e8
commit bbb2f363a0
1 changed files with 102 additions and 100 deletions

View File

@ -28,6 +28,8 @@
static const WCHAR user_agent[] = {'w','i','n','e','t','e','s','t',0};
static const WCHAR test_winehq[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0};
static const WCHAR tests_hello_html[] = {'/','t','e','s','t','s','/','h','e','l','l','o','.','h','t','m','l',0};
static const WCHAR tests_redirect[] = {'/','t','e','s','t','s','/','r','e','d','i','r','e','c','t',0};
enum api
{
@ -45,11 +47,12 @@ struct notification
{
enum api function; /* api responsible for notification */
unsigned int status; /* status received */
BOOL todo;
BOOL ignore;
BOOL skipped_for_proxy;
DWORD flags; /* a combination of NF_* flags */
};
#define NF_ALLOW 0x0001 /* notification may or may not happen */
#define NF_WINE_ALLOW 0x0002 /* wine sends notification when it should not */
struct info
{
enum api function;
@ -60,60 +63,32 @@ struct info
unsigned int line;
};
static BOOL proxy_active(void)
{
WINHTTP_PROXY_INFO proxy_info;
BOOL active = FALSE;
if (WinHttpGetDefaultProxyConfiguration(&proxy_info))
{
active = (proxy_info.lpszProxy != NULL);
if (active)
GlobalFree(proxy_info.lpszProxy);
if (proxy_info.lpszProxyBypass != NULL)
GlobalFree(proxy_info.lpszProxyBypass);
}
else
active = FALSE;
return active;
}
static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID buffer, DWORD buflen )
{
BOOL status_ok, function_ok;
struct info *info = (struct info *)context;
unsigned int i = info->index;
if (status == WINHTTP_CALLBACK_STATUS_HANDLE_CREATED)
{
DWORD size = sizeof(struct info *);
WinHttpQueryOption( handle, WINHTTP_OPTION_CONTEXT_VALUE, &info, &size );
}
ok(i < info->count, "%u: unexpected notification 0x%08x\n", info->line, status);
if (i >= info->count) return;
while (info->index < info->count && info->test[info->index].status != status && (info->test[info->index].flags & NF_ALLOW))
info->index++;
while (info->index < info->count && (info->test[info->index].flags & NF_WINE_ALLOW))
{
todo_wine ok(info->test[info->index].status != status, "unexpected %x notification\n", status);
if (info->test[info->index].status == status) break;
info->index++;
}
ok(info->index < info->count, "%u: unexpected notification 0x%08x\n", info->line, status);
if (info->index >= info->count) return;
status_ok = (info->test[i].status == status);
function_ok = (info->test[i].function == info->function);
if (!info->test[i].ignore && !info->test[i].todo)
{
ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[i].status, status);
ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[i].function, info->function);
}
else if (!info->test[i].ignore)
{
todo_wine ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[i].status, status);
if (status_ok)
{
todo_wine ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[i].function, info->function);
}
}
status_ok = (info->test[info->index].status == status);
function_ok = (info->test[info->index].function == info->function);
ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[info->index].status, status);
ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[info->index].function, info->function);
if (status_ok && function_ok) info->index++;
if (proxy_active())
{
while (info->test[info->index].skipped_for_proxy)
info->index++;
}
if (status & (WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING))
{
@ -133,27 +108,58 @@ static const struct notification cache_test[] =
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }
};
static void setup_test( struct info *info, enum api function, unsigned int line )
{
info->function = function;
info->line = line;
while (info->index < info->count && info->test[info->index].function != function
&& (info->test[info->index].flags & (NF_ALLOW | NF_WINE_ALLOW)))
info->index++;
ok_(__FILE__,line)(info->test[info->index].function == function,
"unexpected function %u, expected %u. probably some notifications were missing\n",
info->test[info->index].function, function);
}
static void test_connection_cache( void )
@ -166,7 +172,7 @@ static void test_connection_cache( void )
info.test = cache_test;
info.count = sizeof(cache_test) / sizeof(cache_test[0]);
info.index = 0;
info.wait = NULL;
info.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 );
ok(ses != NULL, "failed to open session %u\n", GetLastError());
@ -189,7 +195,7 @@ static void test_connection_cache( void )
ok(con != NULL, "failed to open a connection %u\n", GetLastError());
setup_test( &info, winhttp_open_request, __LINE__ );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_hello_html, NULL, NULL, NULL, 0 );
ok(req != NULL, "failed to open a request %u\n", GetLastError());
setup_test( &info, winhttp_send_request, __LINE__ );
@ -211,11 +217,13 @@ static void test_connection_cache( void )
ok(ret, "failed unexpectedly %u\n", GetLastError());
ok(status == 200, "request failed unexpectedly %u\n", status);
ResetEvent( info.wait );
setup_test( &info, winhttp_close_handle, __LINE__ );
WinHttpCloseHandle( req );
WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_open_request, __LINE__ );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_hello_html, NULL, NULL, NULL, 0 );
ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) );
@ -240,8 +248,10 @@ static void test_connection_cache( void )
ok(ret, "failed unexpectedly %u\n", GetLastError());
ok(status == 200, "request failed unexpectedly %u\n", status);
ResetEvent( info.wait );
setup_test( &info, winhttp_close_handle, __LINE__ );
WinHttpCloseHandle( req );
WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_close_handle, __LINE__ );
WinHttpCloseHandle( req );
@ -262,7 +272,6 @@ static void test_connection_cache( void )
ok(status == WAIT_OBJECT_0, "got %08x\n", status);
}
info.index = 0;
ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 );
ok(ses != NULL, "failed to open session %u\n", GetLastError());
@ -283,7 +292,7 @@ static void test_connection_cache( void )
ok(con != NULL, "failed to open a connection %u\n", GetLastError());
setup_test( &info, winhttp_open_request, __LINE__ );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_hello_html, NULL, NULL, NULL, 0 );
ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) );
@ -308,11 +317,13 @@ static void test_connection_cache( void )
ok(ret, "failed unexpectedly %u\n", GetLastError());
ok(status == 200, "request failed unexpectedly %u\n", status);
ResetEvent( info.wait );
setup_test( &info, winhttp_close_handle, __LINE__ );
WinHttpCloseHandle( req );
WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_open_request, __LINE__ );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_hello_html, NULL, NULL, NULL, 0 );
ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) );
@ -340,7 +351,9 @@ static void test_connection_cache( void )
setup_test( &info, winhttp_close_handle, __LINE__ );
done:
WinHttpCloseHandle( req );
WaitForSingleObject( info.wait, INFINITE );
WinHttpCloseHandle( con );
CloseHandle( info.wait );
if (unload)
{
@ -364,28 +377,28 @@ static const struct notification redirect_test[] =
{
{ winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, FALSE, FALSE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, FALSE, FALSE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_ALLOW },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_ALLOW },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_ALLOW },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_ALLOW },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }
};
static void test_redirect( void )
@ -413,7 +426,7 @@ static void test_redirect( void )
ok(con != NULL, "failed to open a connection %u\n", GetLastError());
setup_test( &info, winhttp_open_request, __LINE__ );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_redirect, NULL, NULL, NULL, 0 );
ok(req != NULL, "failed to open a request %u\n", GetLastError());
setup_test( &info, winhttp_send_request, __LINE__ );
@ -446,34 +459,25 @@ static const struct notification async_test[] =
{
{ winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REDIRECT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, FALSE, TRUE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, FALSE, TRUE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, FALSE, FALSE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, FALSE, FALSE, TRUE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_REQUEST_SENT },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED },
{ winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE },
{ winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE },
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, FALSE, TRUE },
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, FALSE, TRUE },
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, FALSE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, TRUE, TRUE }
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW },
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW },
{ winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING },
{ winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }
};
static void test_async( void )
@ -520,7 +524,7 @@ static void test_async( void )
setup_test( &info, winhttp_open_request, __LINE__ );
SetLastError( 0xdeadbeef );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 );
req = WinHttpOpenRequest( con, NULL, tests_hello_html, NULL, NULL, NULL, 0 );
err = GetLastError();
ok(req != NULL, "failed to open a request %u\n", err);
ok(err == ERROR_SUCCESS, "got %u\n", err);
@ -570,16 +574,14 @@ static void test_async( void )
WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_read_data, __LINE__ );
SetLastError( 0xdeadbeef );
ret = WinHttpReadData( req, buffer, sizeof(buffer), NULL );
err = GetLastError();
ok(ret, "failed to read data %u\n", err);
ok(err == ERROR_SUCCESS, "got %u\n", err);
WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_close_handle, __LINE__ );
WinHttpCloseHandle( req );
WaitForSingleObject( info.wait, INFINITE );
WinHttpCloseHandle( con );
if (unload)