[WININET_WINETEST] Sync with Wine Staging 3.9. CORE-14656

This commit is contained in:
Amine Khaldi
2018-06-04 03:57:53 +01:00
parent 12381d5dc1
commit c33584a490
2 changed files with 83 additions and 4 deletions

View File

@@ -5876,11 +5876,22 @@ typedef struct {
} cert_struct_test_t;
static const cert_struct_test_t test_winehq_org_cert = {
"US\r\n"
"55114\r\n"
"MN\r\n"
"Saint Paul\r\n"
"Ste 120\r\n"
"700 Raymond Ave\r\n"
"CodeWeavers\r\n"
"IT\r\n"
"Secure Link SSL Wildcard\r\n"
"*.winehq.org",
"US\r\n"
"GeoTrust Inc.\r\n"
"RapidSSL SHA256 CA"
"VA\r\n"
"Herndon\r\n"
"Network Solutions L.L.C.\r\n"
"Network Solutions OV Server CA 2"
};
static const cert_struct_test_t test_winehq_com_cert = {

View File

@@ -1168,6 +1168,9 @@ static void test_InternetSetOption(void)
ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
ok(ret == TRUE, "InternetSetOption should've succeeded\n");
ret = InternetSetOptionA(con, 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");
@@ -1176,8 +1179,13 @@ static void test_InternetSetOption(void)
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());
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %u\n", GetLastError());
SetLastError(0xdeadbeef);
ret = InternetSetOptionA(con, INTERNET_OPTION_REFRESH, NULL, 0);
ok(ret == FALSE, "InternetSetOption should've failed\n");
ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %u\n", GetLastError());
ret = InternetCloseHandle(req);
ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError());
@@ -1811,6 +1819,65 @@ todo_wine
ok(!buffer[0], "Expected 0 bytes, got %u\n", lstrlenW(buffer));
}
static void test_format_message(HMODULE hdll)
{
DWORD ret;
CHAR out[0x100];
/* These messages come from wininet and not the system. */
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM , NULL, ERROR_INTERNET_TIMEOUT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret == 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_TIMEOUT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INTERNAL_ERROR,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INVALID_URL,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_UNRECOGNIZED_SCHEME,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_NAME_NOT_RESOLVED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_INVALID_OPERATION,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0 || broken(!ret) /* XP, w2k3 */, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_OPERATION_CANCELLED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_ITEM_NOT_FOUND,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_CANNOT_CONNECT,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_CONNECTION_ABORTED,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_SEC_CERT_DATE_INVALID,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_HMODULE, hdll, ERROR_INTERNET_SEC_CERT_CN_INVALID,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out), NULL);
ok(ret != 0, "FormatMessageA returned %d\n", ret);
}
/* ############################### */
START_TEST(internet)
@@ -1877,4 +1944,5 @@ START_TEST(internet)
test_InternetSetOption();
test_end_browser_session();
test_format_message(hdll);
}