static DWORD prot_read, filter_state, http_post_test, thread_id;
static BOOL security_problem, test_async_req, impl_protex;
static BOOL async_read_pending, mimefilter_test, direct_read, wait_for_switch, emulate_prot, short_read, test_abort;
-static BOOL empty_file, no_mime, bind_from_cache;
+static BOOL empty_file, no_mime, bind_from_cache, file_with_hash;
enum {
STATE_CONNECTING,
{
HRESULT hres;
- trace("continue in state %d\n", state);
+ if (winetest_debug > 1)
+ trace("continue in state %d\n", state);
if(state == STATE_CONNECTING) {
if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST || tested_protocol == FTP_TEST) {
'0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0','0','}',0};
static const WCHAR text_plain[] = {'t','e','x','t','/','p','l','a','i','n',0};
- if (ulStatusCode < sizeof(status_names)/sizeof(status_names[0]))
- trace( "progress: %s %s\n", status_names[ulStatusCode], wine_dbgstr_w(szStatusText) );
- else
- trace( "progress: %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText) );
+ if (winetest_debug > 1)
+ {
+ if (ulStatusCode < sizeof(status_names)/sizeof(status_names[0]))
+ trace( "progress: %s %s\n", status_names[ulStatusCode], wine_dbgstr_w(szStatusText) );
+ else
+ trace( "progress: %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText) );
+ }
switch(ulStatusCode) {
case BINDSTATUS_MIMETYPEAVAILABLE:
ok(ulProgress == ulProgressMax, "ulProgress (%d) != ulProgressMax (%d)\n",
ulProgress, ulProgressMax);
- ok(ulProgressMax == 13, "ulProgressMax=%d, expected 13\n", ulProgressMax);
+ if(!file_with_hash)
+ ok(ulProgressMax == 13, "ulProgressMax=%d, expected 13\n", ulProgressMax);
/* BSCF_SKIPDRAINDATAFORFILEURLS added in IE8 */
if(tested_protocol == FILE_TEST)
ok((grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION)) ||
else
ok(hrResult == expect_hrResult, "hrResult = %08x, expected: %08x\n",
hrResult, expect_hrResult);
+#ifdef __REACTOS__
+ if(!winetest_interactive && tested_protocol != FTP_TEST && hrResult != expect_hrResult) {
+ skip("CORE-10360/ROSTESTS-192: Test might hang, skipping the rest!\n");
+ exit(1);
+ }
+#endif
if(SUCCEEDED(hrResult) || tested_protocol == FTP_TEST || test_abort)
ok(dwError == ERROR_SUCCESS, "dwError = %d, expected ERROR_SUCCESS\n", dwError);
else
impl_protex = (flags & TEST_IMPLPROTEX) != 0;
empty_file = (flags & TEST_EMPTY) != 0;
bind_from_cache = (flags & TEST_FROMCACHE) != 0;
+ file_with_hash = FALSE;
register_filter(mimefilter_test);
}
hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
ok(hres == S_OK, "Read failed: %08x\n", hres);
ok(cb == 2, "cb=%u expected 2\n", cb);
+ buf[2] = 0;
+ ok(!memcmp(buf, file_with_hash ? "XX" : "<H", 2), "Unexpected data %s\n", buf);
hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
ok(hres == S_FALSE, "Read failed: %08x\n", hres);
hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
hres = IInternetProtocol_UnlockRequest(protocol);
ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
- ok(hres == S_OK, "Read failed: %08x\n", hres);
+ if(file_with_hash) /* FIXME: An effect of UnlockRequest call? */
+ todo_wine ok(hres == S_OK, "Read failed: %08x\n", hres);
+ else
+ ok(hres == S_OK, "Read failed: %08x\n", hres);
hres = IInternetProtocol_Terminate(protocol, 0);
ok(hres == S_OK, "Terminate failed: %08x\n", hres);
}
static const WCHAR wszFile3[] = {'f','i','l','e',':','/','/','/',0};
static const WCHAR wszFile4[] = {'f','i','l','e',':','\\','\\',0};
static const char html_doc[] = "<HTML></HTML>";
+ static const WCHAR fragmentW[] = {'#','f','r','a','g',0};
trace("Testing file protocol...\n");
init_test(FILE_TEST, 0);
buf[sizeof(wszFile4)/sizeof(WCHAR)] = '|';
test_file_protocol_url(buf);
+ /* Fragment part of URL is skipped if the file doesn't exist. */
+ lstrcatW(buf, fragmentW);
+ test_file_protocol_url(buf);
+
+ /* Fragment part is considered a part of the file name, if the file exsists. */
+ len = lstrlenW(file_name_buf);
+ lstrcpyW(file_name_buf+len, fragmentW);
+ file = CreateFileW(wszIndexHtml, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
+ WriteFile(file, "XXX", 3, &size, NULL);
+ CloseHandle(file);
+ file_name_buf[len] = 0;
+
+ file_with_hash = TRUE;
+ test_file_protocol_url(buf);
+
DeleteFileW(wszIndexHtml);
+ DeleteFileW(file_name_buf);
bindf = 0;
test_file_protocol_fail();
thread_id = GetCurrentThreadId();
test_file_protocol();
-
- if (!winetest_interactive)
- skip("ROSTESTS-165: Skipping test_http_protocol() because of timeouts.\n");
- else
- test_http_protocol();
-
+ test_http_protocol();
if(pCreateUri)
- {
- if (!winetest_interactive)
- skip("ROSTESTS-165: Skipping test_https_protocol() because of timeouts.\n");
- else
- test_https_protocol();
- }
+ test_https_protocol();
else
win_skip("Skipping https tests on too old platform\n");
-
- if (!winetest_interactive)
- skip("ROSTESTS-165: Skipping test_ftp_protocol() because of timeouts.\n");
- else
- test_ftp_protocol();
-
+ test_ftp_protocol();
test_gopher_protocol();
test_mk_protocol();
test_CreateBinding();