[PATCH 2/4] wininet/tests: Add some tests for InternetErrorDlg(FLAGS_ERROR_UI_FILTER_FOR_ERRORS).

Dmitry Timoshkov dmitry at baikal.ru
Fri Aug 6 07:43:12 CDT 2021


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/wininet/tests/internet.c | 41 +++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c
index c61a9793a95..e137f7bd725 100644
--- a/dlls/wininet/tests/internet.c
+++ b/dlls/wininet/tests/internet.c
@@ -1515,7 +1515,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_NOT_SUPPORTED, expected2 = ERROR_SUCCESS, test_flags = 0, j;
 
         for (j = 0; j < ARRAY_SIZE(no_ui_res); ++j)
         {
@@ -1523,6 +1523,7 @@ static void test_InternetErrorDlg(void)
             {
                 test_flags = no_ui_res[j].test_flags;
                 expected = no_ui_res[j].res;
+                expected2 = no_ui_res[j].res;
             }
         }
 
@@ -1554,7 +1555,10 @@ static void test_InternetErrorDlg(void)
         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)
+            {
                 expected = ERROR_CANCELLED;
+                expected2 = ERROR_CANCELLED;
+            }
             break;
         case ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED:
             if (res == NTE_PROV_TYPE_NOT_DEF) /* XP, 2003 */
@@ -1562,15 +1566,24 @@ static void test_InternetErrorDlg(void)
             break;
         case ERROR_INTERNET_CHG_POST_IS_NON_SECURE:
             if(res == ERROR_CANCELLED) /* before win10 returns ERROR_CANCELLED */
+            {
                 expected = ERROR_CANCELLED;
+                expected2 = ERROR_CANCELLED;
+            }
             break;
         default: break;
         }
 
         if(expected == ERROR_NOT_SUPPORTED && res == ERROR_CANCELLED) /* Win10 1607+ */
+        {
             expected = ERROR_CANCELLED;
+            expected2 = ERROR_SUCCESS;
+        }
         else if(expected == ERROR_CANCELLED && res == ERROR_NOT_SUPPORTED) /* XP, Win7, Win8 */
+        {
             expected = ERROR_NOT_SUPPORTED;
+            expected2 = ERROR_SUCCESS;
+        }
 
         todo_wine_if(test_flags & FLAG_TODO)
             ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
@@ -1580,16 +1593,40 @@ static void test_InternetErrorDlg(void)
         todo_wine_if(test_flags & FLAG_TODO)
             ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
 
+        res = InternetErrorDlg(NULL, req, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
+        todo_wine_if(i != ERROR_INTERNET_INCORRECT_PASSWORD && i != ERROR_INTERNET_SEC_CERT_DATE_INVALID &&
+                     i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA &&
+                     i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED &&
+                     i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR && i != ERROR_INTERNET_POST_IS_NON_SECURE)
+        ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
 
         /* With a null req */
         if(test_flags & FLAG_NEEDREQ)
             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 || i == ERROR_INTERNET_INSERT_CDROM || i == ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED)
+        todo_wine_if((test_flags & FLAG_TODO) || i == ERROR_INTERNET_INCORRECT_PASSWORD || i == ERROR_INTERNET_INSERT_CDROM || i == ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED)
             ok(res == expected, "Got %d, expected %d (%d)\n", res, expected, i);
+
+        if(test_flags & FLAG_NEEDREQ)
+            expected2 = ERROR_INVALID_PARAMETER;
+
+        res = InternetErrorDlg(NULL, NULL, i, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
+        todo_wine_if(i != ERROR_INTERNET_SEC_CERT_DATE_INVALID && i != ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR &&
+                     i != ERROR_INTERNET_SEC_CERT_CN_INVALID && i != ERROR_INTERNET_INVALID_CA &&
+                     i != ERROR_INTERNET_SEC_CERT_ERRORS && i != ERROR_INTERNET_SEC_CERT_REV_FAILED &&
+                     i != ERROR_INTERNET_POST_IS_NON_SECURE)
+        ok(res == expected2, "Got %d, expected %d (%d)\n", res, expected2, i);
     }
 
+    res = InternetErrorDlg(NULL, req, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
+todo_wine
+    ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
+
+    res = InternetErrorDlg(NULL, NULL, 0xdeadbeef, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_NO_UI, NULL);
+todo_wine
+    ok(res == ERROR_SUCCESS, "Got %d, expected ERROR_SUCCESS\n", res);
+
     res = InternetCloseHandle(req);
     ok(res == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
     res = InternetCloseHandle(con);
-- 
2.31.1




More information about the wine-devel mailing list