Author: akhaldi Date: Sun Nov 22 10:15:42 2015 New Revision: 70010
URL: http://svn.reactos.org/svn/reactos?rev=70010&view=rev Log: [WININET_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
Modified: trunk/rostests/winetests/wininet/http.c trunk/rostests/winetests/wininet/internet.c trunk/rostests/winetests/wininet/urlcache.c
Modified: trunk/rostests/winetests/wininet/http.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/http.c?r... ============================================================================== --- trunk/rostests/winetests/wininet/http.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/http.c [iso-8859-1] Sun Nov 22 10:15:42 2015 @@ -2127,6 +2127,13 @@ else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "CONNECT ")) + { + if (!strstr(buffer, "Content-Length: 0")) + send(c, notokmsg, sizeof notokmsg-1, 0); + else + send(c, proxymsg, sizeof proxymsg-1, 0); + } if (strstr(buffer, "/test2")) { if (strstr(buffer, "Proxy-Authorization: Basic bWlrZToxMTAx")) @@ -2174,6 +2181,8 @@ { if (strstr(buffer, "Content-Length: 100")) { + if (strstr(buffer, "POST /test7b")) + recvfrom(c, buffer, sizeof buffer, 0, NULL, NULL); send(c, okmsg, sizeof okmsg-1, 0); send(c, page1, sizeof page1-1, 0); } @@ -2490,7 +2499,7 @@ DWORD r, sz; char buffer[0x40];
- hi = InternetOpenA(NULL, 0, NULL, NULL, 0); + hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(hi != NULL, "open failed\n");
hc = InternetConnectA(hi, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); @@ -2884,6 +2893,25 @@ ok(r, "HttpQueryInfo failed\n"); ok(!strcmp(buffer, "200"), "proxy code wrong\n");
+ InternetCloseHandle(hr); + InternetCloseHandle(hc); + InternetCloseHandle(hi); + + sprintf(buffer, "localhost:%d\n", port); + hi = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PROXY, buffer, NULL, 0); + ok(hi != NULL, "InternetOpen failed\n"); + + hc = InternetConnectA(hi, "test.winehq.org", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(hc != NULL, "InternetConnect failed\n"); + + hr = HttpOpenRequestA(hc, "POST", "/test2", NULL, NULL, NULL, INTERNET_FLAG_SECURE, 0); + ok(hr != NULL, "HttpOpenRequest failed\n"); + + r = HttpSendRequestA(hr, NULL, 0, (char *)"data", sizeof("data")); + ok(r, "HttpSendRequest failed %u\n", GetLastError()); + + test_status_code(hr, 407); + done: InternetCloseHandle(hr); InternetCloseHandle(hc); @@ -2959,7 +2987,7 @@ connect = InternetConnectA(session, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); ok(connect != NULL, "InternetConnect failed\n");
- request = HttpOpenRequestA(connect, "POST", "/test7b", NULL, NULL, types, 0, 0); + request = HttpOpenRequestA(connect, "POST", "/test7b", NULL, NULL, types, INTERNET_FLAG_KEEP_CONNECTION, 0); ok(request != NULL, "HttpOpenRequest failed\n");
ret = HttpAddRequestHeadersA(request, "Content-Length: 100\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD_IF_NEW); @@ -2967,8 +2995,8 @@
data_len = sizeof(data); memset(data, 'a', sizeof(data)); - ret = HttpSendRequestA(request, connection, ~0u, data, data_len); - ok(ret, "HttpSendRequest failed\n"); + ret = HttpSendRequestA(request, NULL, 0, data, data_len); + ok(ret, "HttpSendRequest failed: %u\n", GetLastError());
status = 0; size = sizeof(status); @@ -3526,7 +3554,7 @@
hCompleteEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
- session = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC); + session = InternetOpenA("", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); ok(session != NULL,"InternetOpen failed with error %u\n", GetLastError());
pInternetSetStatusCallbackA(session, callback); @@ -3591,7 +3619,7 @@ hCompleteEvent = CreateEventW(NULL, FALSE, FALSE, NULL); conn_close_event = CreateEventW(NULL, FALSE, FALSE, NULL);
- session = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC); + session = InternetOpenA("", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); ok(session != NULL,"InternetOpen failed with error %u\n", GetLastError());
pInternetSetStatusCallbackA(session, callback); @@ -4602,7 +4630,7 @@ HINTERNET ses, con, req; BOOL ret;
- ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n");
con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); @@ -4640,7 +4668,7 @@ DWORD status, size; BOOL ret;
- ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); + ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" );
con = InternetConnectA( ses, "localhost", port, "user", "pwd", @@ -4663,7 +4691,7 @@ InternetCloseHandle( con ); InternetCloseHandle( ses );
- ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); + ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" );
con = InternetConnectA( ses, "localhost", port, NULL, NULL, @@ -4832,7 +4860,7 @@ CertFreeCertificateChain(chain); }else { ok_(__FILE__,line)(!res && GetLastError() == error, - "InternetGetSecurityInfoByURLA returned: %x(%u), exected %u\n", res, GetLastError(), error); + "InternetGetSecurityInfoByURLA returned: %x(%u), expected %u\n", res, GetLastError(), error); } }
@@ -5902,6 +5930,7 @@ WaitForSingleObject( info.wait, 10000 ); Sleep(100); CloseHandle( info.wait ); + DeleteCriticalSection( ¬ification_cs ); }
static HINTERNET closetest_session, closetest_req, closetest_conn; @@ -5976,7 +6005,7 @@ DWORD error; BOOL ret;
- session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(session != NULL, "failed to get session handle\n");
connect = InternetConnectA(session, "localhost", 1, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
Modified: trunk/rostests/winetests/wininet/internet.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/internet... ============================================================================== --- trunk/rostests/winetests/wininet/internet.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/internet.c [iso-8859-1] Sun Nov 22 10:15:42 2015 @@ -1112,30 +1112,44 @@ SetLastError(0xdeadbeef); ulArg = 11; ret = InternetSetOptionA(NULL, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); - ok(ret == FALSE, "InternetQueryOption should've failed\n"); + ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
SetLastError(0xdeadbeef); ulArg = 11; ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, 20); - ok(ret == FALSE, "InternetQueryOption should've failed\n"); + ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %d\n", GetLastError());
ulArg = 11; ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); - ok(ret == TRUE, "InternetQueryOption should've succeeded\n"); + ok(ret == TRUE, "InternetSetOption should've succeeded\n");
SetLastError(0xdeadbeef); ulArg = 4; ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); - ok(ret == FALSE, "InternetQueryOption should've failed\n"); + ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError());
SetLastError(0xdeadbeef); ulArg = 16; ret = InternetSetOptionA(req, INTERNET_OPTION_ERROR_MASK, (void*)&ulArg, sizeof(ULONG)); - ok(ret == FALSE, "InternetQueryOption should've failed\n"); + ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); + + ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(ses, INTERNET_OPTION_REFRESH, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + SetLastError(0xdeadbeef); + ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0); + todo_wine ok(ret == FALSE, "InternetSetOption should've failed\n"); + todo_wine ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError());
ret = InternetCloseHandle(req); ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError()); @@ -1346,6 +1360,35 @@ ok(list.pOptions[1].Value.dwValue == PROXY_TYPE_PROXY, "Retrieved flags should've been PROXY_TYPE_PROXY, was: %d\n", list.pOptions[1].Value.dwValue); + + HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue); + HeapFree(GetProcessHeap(), 0, list.pOptions); + + /* test with NULL as proxy server */ + list.dwOptionCount = 1; + list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA)); + list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; + list.pOptions[0].Value.pszValue = NULL; + + ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + HeapFree(GetProcessHeap(), 0, list.pOptions); + + /* get & verify the proxy server */ + list.dwOptionCount = 1; + list.dwOptionError = 0; + list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA)); + list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; + + ret = InternetQueryOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, &size); + ok(ret == TRUE, "InternetQueryOption should've succeeded\n"); + ok(!list.pOptions[0].Value.pszValue, + "Retrieved proxy server should've been NULL, was: "%s"\n", + list.pOptions[0].Value.pszValue);
HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue); HeapFree(GetProcessHeap(), 0, list.pOptions);
Modified: trunk/rostests/winetests/wininet/urlcache.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/urlcache... ============================================================================== --- trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] Sun Nov 22 10:15:42 2015 @@ -1090,7 +1090,7 @@ ret = CreateUrlCacheEntryA(url_with_slash, 0, "html", filename, 0); ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError());
- create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte)); + create_and_write_file(filename, &zero_byte, sizeof(zero_byte));
ret = CommitUrlCacheEntryA("Visited: http://testing.cache.com/", NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL);