Commit 3f153007 authored by Greg Geldorp's avatar Greg Geldorp Committed by Alexandre Julliard

urlmon/tests: Fix tests when connecting via proxy.

parent 535f0bce
...@@ -221,6 +221,25 @@ static int strcmp_ww(LPCWSTR strw1, LPCWSTR strw2) ...@@ -221,6 +221,25 @@ static int strcmp_ww(LPCWSTR strw1, LPCWSTR strw2)
return lstrcmpA(stra1, stra2); return lstrcmpA(stra1, stra2);
} }
static BOOL proxy_active(void)
{
HKEY internet_settings;
DWORD proxy_enable;
DWORD size;
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
0, KEY_QUERY_VALUE, &internet_settings) != ERROR_SUCCESS)
return FALSE;
size = sizeof(DWORD);
if (RegQueryValueExA(internet_settings, "ProxyEnable", NULL, NULL, (LPBYTE) &proxy_enable, &size) != ERROR_SUCCESS)
proxy_enable = 0;
RegCloseKey(internet_settings);
return proxy_enable != 0;
}
static HRESULT WINAPI HttpSecurity_QueryInterface(IHttpSecurity *iface, REFIID riid, void **ppv) static HRESULT WINAPI HttpSecurity_QueryInterface(IHttpSecurity *iface, REFIID riid, void **ppv)
{ {
if(IsEqualGUID(&IID_IUnknown, riid) if(IsEqualGUID(&IID_IUnknown, riid)
...@@ -581,7 +600,10 @@ static void call_continue(PROTOCOLDATA *protocol_data) ...@@ -581,7 +600,10 @@ static void call_continue(PROTOCOLDATA *protocol_data)
CLEAR_CALLED(ReportProgress_CONNECTING); CLEAR_CALLED(ReportProgress_CONNECTING);
CLEAR_CALLED(ReportProgress_PROXYDETECTING); CLEAR_CALLED(ReportProgress_PROXYDETECTING);
}else if(test_redirect) { }else if(test_redirect) {
CHECK_CALLED(ReportProgress_FINDINGRESOURCE); if (! proxy_active())
CHECK_CALLED(ReportProgress_FINDINGRESOURCE);
else
CLEAR_CALLED(ReportProgress_FINDINGRESOURCE);
}else todo_wine { }else todo_wine {
CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE);
/* IE7 does call this */ /* IE7 does call this */
......
...@@ -246,6 +246,25 @@ static const char *debugstr_guid(REFIID riid) ...@@ -246,6 +246,25 @@ static const char *debugstr_guid(REFIID riid)
return buf; return buf;
} }
static BOOL proxy_active(void)
{
HKEY internet_settings;
DWORD proxy_enable;
DWORD size;
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
0, KEY_QUERY_VALUE, &internet_settings) != ERROR_SUCCESS)
return FALSE;
size = sizeof(DWORD);
if (RegQueryValueExA(internet_settings, "ProxyEnable", NULL, NULL, (LPBYTE) &proxy_enable, &size) != ERROR_SUCCESS)
proxy_enable = 0;
RegCloseKey(internet_settings);
return proxy_enable != 0;
}
static BOOL is_urlmon_protocol(int prot) 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;
...@@ -2799,8 +2818,16 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) ...@@ -2799,8 +2818,16 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
CHECK_CALLED(GetRootSecurityId); CHECK_CALLED(GetRootSecurityId);
} }
if(http_is_first || (test_protocol == HTTPS_TEST && !(flags & BINDTEST_INVALID_CN))) { if(http_is_first || (test_protocol == HTTPS_TEST && !(flags & BINDTEST_INVALID_CN))) {
CHECK_CALLED(OnProgress_FINDINGRESOURCE); if (! proxy_active())
CHECK_CALLED(OnProgress_CONNECTING); {
CHECK_CALLED(OnProgress_FINDINGRESOURCE);
CHECK_CALLED(OnProgress_CONNECTING);
}
else
{
CLEAR_CALLED(OnProgress_FINDINGRESOURCE);
CLEAR_CALLED(OnProgress_CONNECTING);
}
}else todo_wine { }else todo_wine {
CHECK_NOT_CALLED(OnProgress_FINDINGRESOURCE); CHECK_NOT_CALLED(OnProgress_FINDINGRESOURCE);
/* IE7 does call this */ /* IE7 does call this */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment