Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/urlmon/tests/url.c | 228 +++++++++++++++++++++++++++++----------- 1 file changed, 168 insertions(+), 60 deletions(-)
diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 69ec00476ff..15a90864aea 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -91,6 +91,7 @@ DEFINE_EXPECT(QueryInterface_IBindStatusCallback); DEFINE_EXPECT(QueryInterface_IBindStatusCallbackEx); DEFINE_EXPECT(QueryInterface_IBindStatusCallbackHolder); DEFINE_EXPECT(QueryInterface_IAuthenticate); +DEFINE_EXPECT(QueryInterface_IAuthenticateEx); DEFINE_EXPECT(QueryInterface_IInternetProtocol); DEFINE_EXPECT(QueryInterface_IWindowForBindingUI); DEFINE_EXPECT(QueryInterface_IHttpSecurity); @@ -148,6 +149,7 @@ DEFINE_EXPECT(GetWindow_IHttpSecurity); DEFINE_EXPECT(GetWindow_IWindowForBindingUI); DEFINE_EXPECT(GetWindow_ICodeInstall); DEFINE_EXPECT(OnSecurityProblem); +DEFINE_EXPECT(Authenticate_Authenticate);
static const WCHAR winetest_data_urlW[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/', @@ -159,8 +161,9 @@ static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0}; static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
#define WINEHQ_IP "4.4.81.124" +#define WINEHQ_IPW L"4.4.81.124" static const WCHAR wszWineHQSite[] = L"www.winehq.org"; -static const WCHAR wszWineHQIP[] = L"" WINEHQ_IP; +static const WCHAR wszWineHQIP[] = L"" WINEHQ_IPW; static const CHAR wszIndexHtmlA[] = "index.html"; static const WCHAR cache_fileW[] = {'c',':','\','c','a','c','h','e','.','h','t','m',0}; static const CHAR dwl_htmlA[] = "dwl.html"; @@ -191,6 +194,10 @@ static BOOL async_switch = FALSE; static BOOL strict_bsc_qi; static DWORD bindtest_flags; static const char *test_file; +static BOOL auth_supported = FALSE; +static BOOL auth_fail = FALSE; +static BOOL auth_ask_for_credentials = FALSE; +static DWORD response_code = 200;
static WCHAR file_url[INTERNET_MAX_URL_LENGTH], current_url[INTERNET_MAX_URL_LENGTH];
@@ -203,7 +210,8 @@ static enum { HTTPS_TEST, FTP_TEST, WINETEST_TEST, - WINETEST_SYNC_TEST + WINETEST_SYNC_TEST, + HTTP_BASIC_AUTH_TEST } test_protocol;
static enum { @@ -233,7 +241,7 @@ static BOOL proxy_active(void)
static BOOL is_urlmon_protocol(int prot) { - return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST; + return prot == FILE_TEST || prot == HTTP_TEST || prot == HTTPS_TEST || prot == FTP_TEST || prot == MK_TEST || prot == HTTP_BASIC_AUTH_TEST; }
static void test_CreateURLMoniker(LPCWSTR url1, LPCWSTR url2) @@ -1240,7 +1248,7 @@ static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface,
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
- ok(!lstrcmpW(szURL, current_url), "szURL != current_url\n"); + ok(!lstrcmpW(szURL, current_url), "got %s, expected %s\n", debugstr_w(szURL), debugstr_w(current_url)); ok(!dwReserved, "dwReserved=%d, expected 0\n", dwReserved); ok(pszAdditionalHeaders != NULL, "pszAdditionalHeaders == NULL\n"); if(pszAdditionalHeaders) @@ -1256,9 +1264,12 @@ static HRESULT WINAPI HttpNegotiate_OnResponse(IHttpNegotiate2 *iface, DWORD dwR
ok(GetCurrentThreadId() == thread_id, "wrong thread %d\n", GetCurrentThreadId());
- ok(dwResponseCode == 200, "dwResponseCode=%d, expected 200\n", dwResponseCode); + ok(dwResponseCode == response_code, "dwResponseCode=%d, expected %u\n", dwResponseCode, response_code); ok(szResponseHeaders != NULL, "szResponseHeaders == NULL\n"); - ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n"); + if (auth_supported) + ok(szRequestHeaders != NULL, "szRequestHeaders == NULL\n"); + else + ok(szRequestHeaders == NULL, "szRequestHeaders != NULL\n"); /* Note: in protocol.c tests, OnResponse pszAdditionalRequestHeaders _is_ NULL */ ok(pszAdditionalRequestHeaders != NULL, "pszAdditionalHeaders == NULL\n"); if(pszAdditionalRequestHeaders) @@ -1437,6 +1448,62 @@ static IServiceProviderVtbl ServiceProviderVtbl = {
static IServiceProvider ServiceProvider = { &ServiceProviderVtbl };
+static HRESULT WINAPI Authenticate_QueryInterface(IAuthenticate *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IAuthenticateEx)) { + CHECK_EXPECT(QueryInterface_IAuthenticateEx); + *ppv = NULL; + return E_NOINTERFACE; + } + + if(IsEqualGUID(riid, &IID_IAuthenticate)) { + CHECK_EXPECT(QueryInterface_IAuthenticate); + *ppv = iface; + return S_OK; + } + + ok(0, "Unexpected interface requested: %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI Authenticate_AddRef(IAuthenticate *iface) +{ + return 2; +} + +static ULONG WINAPI Authenticate_Release(IAuthenticate *iface) +{ + return 1; +} + +static HRESULT WINAPI Authenticate_Authenticate(IAuthenticate *iface, HWND *hwnd, LPWSTR *user, LPWSTR *pass) +{ + if (winetest_debug > 1) + trace("IAuthenticate::Authenticate()\n"); + + CHECK_EXPECT(Authenticate_Authenticate); + + if(auth_fail) + return E_NOTIMPL; + + if(auth_ask_for_credentials) { + binding_hres = INET_E_DATA_NOT_AVAILABLE; + *hwnd = GetDesktopWindow(); + }else + *hwnd = 0; + *user = *pass = NULL; + return S_OK; +} + +static IAuthenticateVtbl AuthenticateVtbl = { + Authenticate_QueryInterface, + Authenticate_AddRef, + Authenticate_Release, + Authenticate_Authenticate +}; + +static IAuthenticate Authenticate = { &AuthenticateVtbl }; + static IBindStatusCallbackEx objbsc;
static void test_WinInetHttpInfo(IWinInetHttpInfo *http_info, DWORD progress) @@ -1465,7 +1532,7 @@ static void test_WinInetHttpInfo(IWinInetHttpInfo *http_info, DWORD progress) if(download_state == BEFORE_DOWNLOAD && progress != BINDSTATUS_MIMETYPEAVAILABLE && progress != BINDSTATUS_DECODING) ok(status == 0, "progress %u: status = %d\n", progress, status); else - ok(status == HTTP_STATUS_OK, "progress %u: status = %d\n", progress, status); + ok(status == response_code, "progress %u: status = %d, expected %d\n", progress, status, response_code); ok(size == sizeof(DWORD), "size = %d\n", size); }
@@ -1513,6 +1580,11 @@ static HRESULT WINAPI statusclb_QueryInterface(IBindStatusCallbackEx *iface, REF return S_OK; }else if (IsEqualGUID(&IID_IAuthenticate, riid)) { CHECK_EXPECT(QueryInterface_IAuthenticate); + if (auth_supported) + { + *ppv = &Authenticate; + return S_OK; + } return E_NOINTERFACE; }else if(IsEqualGUID(&IID_IBindStatusCallback, riid)) { if(strict_bsc_qi) @@ -1843,6 +1915,7 @@ static HRESULT WINAPI statusclb_OnStopBinding(IBindStatusCallbackEx *iface, HRES else ok(hresult == E_ABORT, "binding failed: %08x, expected E_ABORT\n", hresult); } else +todo_wine_if(auth_ask_for_credentials) ok(hresult == binding_hres, "binding failed: %08x, expected %08x\n", hresult, binding_hres); ok(szError == NULL, "szError should be NULL\n");
@@ -1873,7 +1946,7 @@ static HRESULT WINAPI statusclb_OnStopBinding(IBindStatusCallbackEx *iface, HRES ok(IsEqualCLSID(&clsid, &CLSID_FileProtocol), "incorrect protocol CLSID: %s, expected CLSID_FileProtocol\n", wine_dbgstr_guid(&clsid)); - }else if(test_protocol == HTTP_TEST) { + }else if(test_protocol == HTTP_TEST || test_protocol == HTTP_BASIC_AUTH_TEST) { ok(IsEqualCLSID(&clsid, &CLSID_HttpProtocol), "incorrect protocol CLSID: %s, expected CLSID_HttpProtocol\n", wine_dbgstr_guid(&clsid)); @@ -2844,13 +2917,17 @@ static void init_bind_test(int protocol, DWORD flags, DWORD t) stopped_obj_binding = FALSE; data_available = FALSE; mime_type[0] = 0; - binding_hres = S_OK; + binding_hres = protocol == HTTP_BASIC_AUTH_TEST ? E_ACCESSDENIED : S_OK; bind_to_object = (flags & BINDTEST_TOOBJECT) != 0; tymed = t; filedwl_api = (flags & BINDTEST_FILEDWLAPI) != 0; post_test = (flags & BINDTEST_HTTPRESPONSE) != 0;
switch(protocol) { + case HTTP_BASIC_AUTH_TEST: + lstrcpyW(current_url, L"http://httpbin.org/basic-auth/foo/bar"); + break; + case HTTP_TEST: if(post_test) url_a = "http://test.winehq.org/tests/post.php"; @@ -2890,7 +2967,7 @@ static void init_bind_test(int protocol, DWORD flags, DWORD t) abort_start = (flags & BINDTEST_ABORT_START) != 0; abort_progress = (flags & BINDTEST_ABORT_PROGRESS) != 0; async_switch = (flags & BINDTEST_ASYNC_SWITCH) != 0; - is_async_prot = protocol == HTTP_TEST || protocol == HTTPS_TEST || protocol == FTP_TEST || protocol == WINETEST_TEST; + is_async_prot = protocol == HTTP_TEST || protocol == HTTPS_TEST || protocol == FTP_TEST || protocol == WINETEST_TEST || protocol == HTTP_BASIC_AUTH_TEST; prot_state = 0; ResetEvent(complete_event);
@@ -3005,7 +3082,7 @@ static void test_MonikerComposeWith(void) IMoniker_Release(outmon); }
-static void test_BindToStorage(int protocol, DWORD flags, DWORD t) +static void test_BindToStorage(int protocol, DWORD flags, DWORD t, DWORD exhres) { IMoniker *mon; HRESULT hres; @@ -3018,6 +3095,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) IBinding *bind;
init_bind_test(protocol, flags, t); + binding_hres = exhres; allow_finding_resource = (flags & BINDTEST_ALLOW_FINDINGRESOURCE) != 0;
if(no_callback) { @@ -3073,7 +3151,6 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) binding_hres = INET_E_INVALID_CERTIFICATE; }
- if(only_check_prot_args) SET_EXPECT(OnStopBinding); if(!no_callback) { @@ -3094,7 +3171,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) if(tymed != TYMED_FILE || (test_protocol != ABOUT_TEST && test_protocol != ITS_TEST)) SET_EXPECT(UnlockRequest); }else { - if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) { + if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST || test_protocol == HTTP_BASIC_AUTH_TEST) { SET_EXPECT(QueryService_IInternetBindInfo); if(!abort_start) SET_EXPECT(QueryInterface_IHttpNegotiate); @@ -3119,9 +3196,16 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) } if(!no_callback) { if((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FTP_TEST - || test_protocol == FILE_TEST || test_protocol == WINETEST_TEST) && !abort_start) + || test_protocol == FILE_TEST || test_protocol == WINETEST_TEST || test_protocol == HTTP_BASIC_AUTH_TEST) && !abort_start) SET_EXPECT(OnProgress_SENDINGREQUEST); - if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST) { + if(test_protocol == HTTP_BASIC_AUTH_TEST) { + SET_EXPECT(QueryInterface_IAuthenticate); + SET_EXPECT(QueryInterface_IAuthenticateEx); + if (!auth_supported) + SET_EXPECT(QueryService_IAuthenticate); + SET_EXPECT(Authenticate_Authenticate); + } + if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST || test_protocol == HTTP_BASIC_AUTH_TEST) { SET_EXPECT(QueryInterface_IHttpNegotiate); SET_EXPECT(OnResponse); } @@ -3142,7 +3226,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) }
hres = IMoniker_BindToStorage(mon, bctx, NULL, tymed == TYMED_ISTREAM ? &IID_IStream : &IID_IUnknown, (void**)&unk); - if ((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) + if ((test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == HTTP_BASIC_AUTH_TEST) && hres == HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED)) { skip("Network unreachable, skipping tests\n"); @@ -3183,6 +3267,10 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) invalid_cn_accepted = FALSE; binding_hres = INET_E_INVALID_CERTIFICATE; } + }else if(FAILED(binding_hres)) { +todo_wine_if(auth_ask_for_credentials) + ok(hres == exhres, "IMoniker_BindToStorage failed: %08x, expected %08x\n", hres, exhres); + ok(!unk, "unk = %p, expected NULL\n", unk); }else { ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres); ok(unk != NULL, "unk == NULL\n"); @@ -3302,7 +3390,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) CHECK_CALLED(OnDataAvailable); else CHECK_NOT_CALLED(OnDataAvailable); - }else if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start) + }else if((tymed != TYMED_FILE || test_protocol != ABOUT_TEST) && !abort_start && binding_hres == S_OK) CHECK_CALLED(OnDataAvailable); CHECK_CALLED(OnStopBinding); } @@ -4033,10 +4121,30 @@ START_TEST(url) test_BindToStorage_fail();
trace("synchronous http test (COM not initialised)...\n"); - test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM, S_OK);
CoInitialize(NULL);
+ http_is_first = TRUE; + trace("IAuthenticate test...\n"); + test_BindToStorage(HTTP_BASIC_AUTH_TEST, 0, 0, E_ACCESSDENIED); + + auth_supported = TRUE; + trace("IAuthenticate test (auth_supported)...\n"); + test_BindToStorage(HTTP_BASIC_AUTH_TEST, 0, 0, E_ACCESSDENIED); + + if(winetest_interactive) { /* Press ESC when asked for credentials*/ + auth_ask_for_credentials = TRUE; + response_code = 401; + trace("IAuthenticate interactive test...\n"); + test_BindToStorage(HTTP_BASIC_AUTH_TEST, 0, 0, S_OK); + } + + auth_supported = FALSE; + auth_ask_for_credentials = FALSE; + http_is_first = FALSE; + response_code = 200; + trace("test StdURLMoniker...\n"); test_StdURLMoniker();
@@ -4044,28 +4152,28 @@ START_TEST(url) test_MonikerComposeWith();
trace("synchronous http test...\n"); - test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM, S_OK);
trace("emulated synchronous http test (to file)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("synchronous http test (to object)...\n"); test_BindToObject(HTTP_TEST, 0, S_OK);
trace("emulated synchronous http test (with cache)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM, S_OK);
trace("emulated synchronous http test (with cache, no read)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM, 0);
trace("synchronous http test (with cache, no read)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_USE_CACHE|BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM, S_OK);
trace("synchronous file test...\n"); - test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM, 0);
trace("emulated synchronous file test (to file)...\n"); - test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("synchronous file test (to object)...\n"); test_BindToObject(FILE_TEST, 0, S_OK); @@ -4076,31 +4184,31 @@ START_TEST(url) create_html_file();
trace("file test (no callback)...\n"); - test_BindToStorage(FILE_TEST, BINDTEST_NO_CALLBACK, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, BINDTEST_NO_CALLBACK, TYMED_ISTREAM, S_OK);
if(can_do_https()) { trace("synchronous https test (invalid CN, dialog)\n"); onsecurityproblem_hres = S_FALSE; http_is_first = TRUE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM, S_OK);
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
trace("asynchronous https test (invalid CN, fail)\n"); onsecurityproblem_hres = E_FAIL; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM, S_OK);
trace("asynchronous https test (invalid CN, accept)\n"); onsecurityproblem_hres = S_OK; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM, S_OK);
trace("asynchronous https test (invalid CN, dialog 2)\n"); onsecurityproblem_hres = S_FALSE; - test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_INVALID_CN, TYMED_ISTREAM, S_OK); invalid_cn_accepted = FALSE;
trace("asynchronous https test...\n"); - test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM, S_OK); }else { win_skip("Skipping https tests\n"); } @@ -4108,39 +4216,39 @@ START_TEST(url) bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
trace("winetest test (async switch)...\n"); - test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_ASYNC_SWITCH, TYMED_ISTREAM); + test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_ASYNC_SWITCH, TYMED_ISTREAM, S_OK);
trace("about test (no read)...\n"); - test_BindToStorage(ABOUT_TEST, BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM); + test_BindToStorage(ABOUT_TEST, BINDTEST_NO_CALLBACK_READ, TYMED_ISTREAM, S_OK);
trace("http test...\n"); - test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM, 0);
trace("http test (to file)...\n"); - test_BindToStorage(HTTP_TEST, 0, TYMED_FILE); + test_BindToStorage(HTTP_TEST, 0, TYMED_FILE, 0);
trace("http test (to object)...\n"); test_BindToObject(HTTP_TEST, 0, S_OK);
trace("http test (short response)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_ISTREAM, S_OK);
trace("http test (short response, to object)...\n"); test_BindToObject(HTTP_TEST, 0, S_OK);
trace("http test (abort start binding E_NOTIMPL)...\n"); abort_hres = E_NOTIMPL; - test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE, S_OK);
trace("http test (abort start binding E_ABORT)...\n"); abort_hres = E_ABORT; - test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_START, TYMED_FILE, S_OK);
trace("http test (abort progress)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_PROGRESS|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_ABORT_PROGRESS|BINDTEST_ALLOW_FINDINGRESOURCE, TYMED_FILE, S_OK);
trace("emulated http test...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("emulated http test (to object)...\n"); test_BindToObject(HTTP_TEST, BINDTEST_EMULATE, S_OK); @@ -4149,67 +4257,67 @@ START_TEST(url) test_BindToObject(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, S_OK);
trace("emulated http test (to file)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("emulated http test (redirect)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, TYMED_ISTREAM, S_OK);
trace("emulated http test (with cache)...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_USE_CACHE, TYMED_ISTREAM, S_OK);
trace("winetest test (no callback)...\n"); - test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM); + test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM, S_OK);
trace("emulated https test...\n"); - test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("about test...\n"); - test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM, S_OK);
trace("about test (to file)...\n"); - test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE); + test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE, S_OK);
trace("about test (to object)...\n"); test_BindToObject(ABOUT_TEST, 0, S_OK);
trace("emulated about test...\n"); - test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("emulated about test (to file)...\n"); - test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("emulated about test (to object)...\n"); test_BindToObject(ABOUT_TEST, BINDTEST_EMULATE, S_OK);
trace("emulalated test reporting result in read...\n"); - test_BindToStorage(WINETEST_SYNC_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(WINETEST_SYNC_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("file test...\n"); - test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM, S_OK);
trace("file test (to file)...\n"); - test_BindToStorage(FILE_TEST, 0, TYMED_FILE); + test_BindToStorage(FILE_TEST, 0, TYMED_FILE, S_OK);
trace("file test (to object)...\n"); test_BindToObject(FILE_TEST, 0, S_OK);
trace("emulated file test...\n"); - test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("emulated file test (to file)...\n"); - test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("emulated file test (to object)...\n"); test_BindToObject(FILE_TEST, BINDTEST_EMULATE, S_OK);
trace("emulated its test...\n"); - test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("emulated its test (to file)...\n"); - test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_FILE); + test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_FILE, S_OK);
trace("emulated mk test...\n"); - test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK);
trace("test URLDownloadToFile for file protocol...\n"); test_URLDownloadToFile(FILE_TEST, FALSE); @@ -4224,12 +4332,12 @@ START_TEST(url) test_URLDownloadToFile_abort();
trace("test emulated http abort...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_ABORT, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_ABORT, TYMED_ISTREAM, S_OK);
bindf |= BINDF_NOWRITECACHE;
trace("ftp test...\n"); - test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM); + test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM, S_OK);
trace("test failures...\n"); test_BindToStorage_fail(); @@ -4238,7 +4346,7 @@ START_TEST(url) only_check_prot_args = TRUE; /* Fail after checking arguments to Protocol_Start */
trace("check emulated http protocol arguments...\n"); - test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM, S_OK); }
DeleteFileA(test_file);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92939
Your paranoid android.
=== w8adm (32 bit report) ===
urlmon: url.c:1919: Test failed: binding failed: 800c0005, expected 00000000 url.c:1930: Test failed: res = 00002ee7, expected 00000000 url.c:3275: Test failed: IMoniker_BindToStorage failed: 800c0005 url.c:3276: Test failed: unk == NULL
=== w1064v1507 (32 bit report) ===
urlmon: url.c:3838: Test failed: expected OnProgress_DOWNLOADINGDATA
=== w1064_tsign (32 bit report) ===
urlmon: url.c:3838: Test failed: expected OnProgress_DOWNLOADINGDATA
=== w1064v1507 (64 bit report) ===
urlmon: url.c:3838: Test failed: expected OnProgress_DOWNLOADINGDATA
Hi Dmitry,
On 6/22/21 4:54 PM, Dmitry Timoshkov wrote:
- case HTTP_BASIC_AUTH_TEST:
lstrcpyW(current_url, L"http://httpbin.org/basic-auth/foo/bar");
Using 3-rd party web pages in our tests is rather suboptimal. It should be doable with a simple PHP scripts, like we do in other tests, see:
https://source.winehq.org/git/tools.git/tree/HEAD:/winetest/tests
Thanks,
Jacek
Jacek Caban jacek@codeweavers.com wrote:
On 6/22/21 4:54 PM, Dmitry Timoshkov wrote:
- case HTTP_BASIC_AUTH_TEST:
lstrcpyW(current_url, L"http://httpbin.org/basic-auth/foo/bar");
Using 3-rd party web pages in our tests is rather suboptimal.
Sure.
It should be doable with a simple PHP scripts, like we do in other tests, see:
https://source.winehq.org/git/tools.git/tree/HEAD:/winetest/tests
Since I'm not fluent with PHP I'd rather use an existitng service, or prefer if someone else would add it to winehq. Would you mind adding such a script?
Thanks.
On 6/22/21 9:41 PM, Dmitry Timoshkov wrote:
Jacek Caban jacek@codeweavers.com wrote:
It should be doable with a simple PHP scripts, like we do in other tests, see:
https://source.winehq.org/git/tools.git/tree/HEAD:/winetest/tests
Since I'm not fluent with PHP I'd rather use an existitng service, or prefer if someone else would add it to winehq. Would you mind adding such a script?
You may use a Perl CGI script, if you prefer.
Jacek
Jacek Caban jacek@codeweavers.com wrote:
On 6/22/21 9:41 PM, Dmitry Timoshkov wrote:
Jacek Caban jacek@codeweavers.com wrote:
It should be doable with a simple PHP scripts, like we do in other tests, see:
https://source.winehq.org/git/tools.git/tree/HEAD:/winetest/tests
Since I'm not fluent with PHP I'd rather use an existitng service, or prefer if someone else would add it to winehq. Would you mind adding such a script?
You may use a Perl CGI script, if you prefer.
Frankly, I'd prefer to avoid fiddling with winehq testing backend, or just drop the patch with the tests, although I'd like to see it accepted to make further development easier.
Jacek Caban jacek@codeweavers.com wrote:
On 6/22/21 4:54 PM, Dmitry Timoshkov wrote:
- case HTTP_BASIC_AUTH_TEST:
lstrcpyW(current_url, L"http://httpbin.org/basic-auth/foo/bar");
Using 3-rd party web pages in our tests is rather suboptimal.
We are using external services in other places like LDAP tests, so, while this is not an ideal solution it could still be acceptable while winehq hosted service is missing. I'd ask to accept the patches as is and once we have our own basic authentication harness then switch to usung it.