Commit b340956e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Prefer recent windows results in InternetErrorDlg tests.

Based on patch by Dmitry Timoshkov. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6cdccb21
......@@ -1463,9 +1463,8 @@ static void test_Option_PerConnectionOptionA(void)
HeapFree(GetProcessHeap(), 0, list.pOptions);
}
#define FLAG_TODO 0x1
#define FLAG_NEEDREQ 0x2
#define FLAG_UNIMPL 0x4
#define FLAG_NEEDREQ 0x1
#define FLAG_UNIMPL 0x2
static void test_InternetErrorDlg(void)
{
......@@ -1482,21 +1481,22 @@ static void test_InternetErrorDlg(void)
{ ERROR_INTERNET_SEC_CERT_DATE_INVALID , ERROR_CANCELLED, 0 },
{ ERROR_INTERNET_SEC_CERT_CN_INVALID , ERROR_CANCELLED, 0 },
{ ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR , ERROR_SUCCESS, 0 },
{ ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR , ERROR_SUCCESS, FLAG_TODO },
{ ERROR_INTERNET_MIXED_SECURITY , ERROR_CANCELLED, FLAG_TODO },
{ ERROR_INTERNET_CHG_POST_IS_NON_SECURE , ERROR_CANCELLED, FLAG_TODO },
{ ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR , ERROR_SUCCESS },
{ ERROR_INTERNET_MIXED_SECURITY , ERROR_CANCELLED },
{ ERROR_INTERNET_CHG_POST_IS_NON_SECURE , ERROR_SUCCESS },
{ ERROR_INTERNET_POST_IS_NON_SECURE , ERROR_SUCCESS, 0 },
{ ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED, ERROR_CANCELLED, FLAG_NEEDREQ|FLAG_TODO },
{ ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED, ERROR_CANCELLED, FLAG_NEEDREQ },
{ ERROR_INTERNET_INVALID_CA , ERROR_CANCELLED, 0 },
{ ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR, ERROR_CANCELLED, FLAG_TODO },
{ ERROR_INTERNET_INSERT_CDROM , ERROR_CANCELLED, FLAG_TODO|FLAG_NEEDREQ|FLAG_UNIMPL },
{ ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR, ERROR_CANCELLED },
{ ERROR_INTERNET_INSERT_CDROM , ERROR_CANCELLED, FLAG_NEEDREQ|FLAG_UNIMPL },
{ ERROR_INTERNET_SEC_CERT_ERRORS , ERROR_CANCELLED, 0 },
{ ERROR_INTERNET_SEC_CERT_REV_FAILED , ERROR_CANCELLED, 0 },
{ ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION , ERROR_HTTP_COOKIE_DECLINED, FLAG_TODO },
{ ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT , ERROR_CANCELLED, FLAG_TODO },
{ ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT, ERROR_CANCELLED, FLAG_TODO },
{ ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION, ERROR_CANCELLED, FLAG_TODO },
{ ERROR_INTERNET_SEC_CERT_REVOKED , ERROR_CANCELLED, 0 },
{ ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION , ERROR_HTTP_COOKIE_DECLINED },
{ ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT , ERROR_CANCELLED },
{ ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT, ERROR_CANCELLED },
{ ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION, ERROR_CANCELLED },
{ ERROR_INTERNET_SEC_CERT_REVOKED , ERROR_CANCELLED },
{ ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE, ERROR_CANCELLED },
};
res = InternetErrorDlg(NULL, NULL, ERROR_INTERNET_SEC_CERT_ERRORS, 0, NULL);
......@@ -1514,7 +1514,7 @@ static void test_InternetErrorDlg(void)
for(i = INTERNET_ERROR_BASE; i < INTERNET_ERROR_LAST; i++)
{
DWORD expected = ERROR_NOT_SUPPORTED, test_flags = 0, j;
DWORD expected = ERROR_CANCELLED, test_flags = 0, j;
for (j = 0; j < ARRAY_SIZE(no_ui_res); ++j)
{
......@@ -1549,32 +1549,27 @@ static void test_InternetErrorDlg(void)
/* Handle some special cases */
switch(i)
{
case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: /* later 9.x versions */
case ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR: /* later 9.x versions */
case ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE: /* later 11.x versions */
if(res == ERROR_CANCELLED)
case ERROR_INTERNET_CHG_POST_IS_NON_SECURE:
if (broken(res == ERROR_CANCELLED)) /* before win10 returns ERROR_CANCELLED */
expected = ERROR_CANCELLED;
break;
case ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED:
if (res == NTE_PROV_TYPE_NOT_DEF) /* XP, 2003 */
expected = NTE_PROV_TYPE_NOT_DEF;
break;
case ERROR_INTERNET_CHG_POST_IS_NON_SECURE:
if(res == ERROR_SUCCESS) /* win10 returns ERROR_SUCCESS */
expected = ERROR_SUCCESS;
default:
if(broken((expected == ERROR_CANCELLED || i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE) &&
res == ERROR_NOT_SUPPORTED)) /* XP, Win7, Win8 */
expected = ERROR_NOT_SUPPORTED;
break;
default: break;
}
if (expected == ERROR_NOT_SUPPORTED && res == ERROR_CANCELLED) /* Win10 1607+ */
expected = ERROR_CANCELLED;
todo_wine_if(test_flags & FLAG_TODO)
todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
/* Same thing with NULL hwnd */
res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
todo_wine_if(test_flags & FLAG_TODO)
todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
......@@ -1583,7 +1578,12 @@ static void test_InternetErrorDlg(void)
expected = ERROR_INVALID_PARAMETER;
res = InternetErrorDlg(hwnd, NULL, i, FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
todo_wine_if( test_flags & FLAG_TODO || i == ERROR_INTERNET_INCORRECT_PASSWORD)
todo_wine_if(i == ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION ||
i == ERROR_INTERNET_INCORRECT_PASSWORD ||
i == ERROR_INTERNET_INSERT_CDROM ||
i == ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED ||
i == ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR ||
i == ERROR_INTERNET_CHG_POST_IS_NON_SECURE)
ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
}
......
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