Author: cwittich
Date: Fri Mar 5 19:47:06 2010
New Revision: 45885
URL:
http://svn.reactos.org/svn/reactos?rev=45885&view=rev
Log:
[URLMON_WINETEST]
sync urlmon_winetest to wine 1.1.39
Modified:
trunk/rostests/winetests/urlmon/misc.c
trunk/rostests/winetests/urlmon/protocol.c
trunk/rostests/winetests/urlmon/sec_mgr.c
trunk/rostests/winetests/urlmon/stream.c
trunk/rostests/winetests/urlmon/url.c
Modified: trunk/rostests/winetests/urlmon/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/misc.c?r…
==============================================================================
--- trunk/rostests/winetests/urlmon/misc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/urlmon/misc.c [iso-8859-1] Fri Mar 5 19:47:06 2010
@@ -270,6 +270,10 @@
static const WCHAR wszAbout[] =
{'a','b','o','u','t',0};
static const WCHAR wszEmpty[] = {0};
+static const WCHAR wszWineHQ[] =
{'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
+static const WCHAR wszHttpWineHQ[] =
{'h','t','t','p',':','/','/','w','w','w','.',
+
'w','i','n','e','h','q','.','o','r','g',0};
+
struct parse_test {
LPCWSTR url;
HRESULT secur_hres;
@@ -277,15 +281,19 @@
HRESULT path_hres;
LPCWSTR path;
LPCWSTR schema;
+ LPCWSTR domain;
+ HRESULT domain_hres;
+ LPCWSTR rootdocument;
+ HRESULT rootdocument_hres;
};
static const struct parse_test parse_tests[] = {
- {url1, S_OK, url1, E_INVALIDARG, NULL, wszRes},
- {url2, E_FAIL, url2, E_INVALIDARG, NULL, wszEmpty},
- {url3, E_FAIL, url3, S_OK, path3, wszFile},
- {url4, E_FAIL, url4e, S_OK, path4, wszFile},
- {url5, E_FAIL, url5, E_INVALIDARG, NULL, wszHttp},
- {url6, S_OK, url6, E_INVALIDARG, NULL, wszAbout}
+ {url1, S_OK, url1, E_INVALIDARG, NULL, wszRes, NULL, E_FAIL, NULL, E_FAIL},
+ {url2, E_FAIL, url2, E_INVALIDARG, NULL, wszEmpty, NULL, E_FAIL, NULL, E_FAIL},
+ {url3, E_FAIL, url3, S_OK, path3, wszFile, wszEmpty, S_OK, NULL, E_FAIL},
+ {url4, E_FAIL, url4e, S_OK, path4, wszFile, wszEmpty, S_OK, NULL, E_FAIL},
+ {url5, E_FAIL, url5, E_INVALIDARG, NULL, wszHttp, wszWineHQ, S_OK, wszHttpWineHQ,
S_OK},
+ {url6, S_OK, url6, E_INVALIDARG, NULL, wszAbout, NULL, E_FAIL, NULL, E_FAIL},
};
static void test_CoInternetParseUrl(void)
@@ -331,6 +339,23 @@
ok(hres == S_OK, "[%d] schema failed: %08x\n", i, hres);
ok(size == lstrlenW(parse_tests[i].schema), "[%d] wrong size\n", i);
ok(!lstrcmpW(parse_tests[i].schema, buf), "[%d] wrong schema\n", i);
+
+ if(memcmp(parse_tests[i].url, wszRes, 3*sizeof(WCHAR))
+ && memcmp(parse_tests[i].url, wszAbout, 5*sizeof(WCHAR))) {
+ memset(buf, 0xf0, sizeof(buf));
+ hres = CoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ok(hres == parse_tests[i].domain_hres, "[%d] domain failed:
%08x\n", i, hres);
+ if(parse_tests[i].domain)
+ ok(!lstrcmpW(parse_tests[i].domain, buf), "[%d] wrong domain,
received %s\n", i, wine_dbgstr_w(buf));
+ }
+
+ memset(buf, 0xf0, sizeof(buf));
+ hres = CoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf,
+ sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ok(hres == parse_tests[i].rootdocument_hres, "[%d] rootdocument failed:
%08x\n", i, hres);
+ if(parse_tests[i].rootdocument)
+ ok(!lstrcmpW(parse_tests[i].rootdocument, buf), "[%d] wrong
rootdocument, received %s\n", i, wine_dbgstr_w(buf));
}
}
@@ -755,7 +780,19 @@
PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult,
DWORD *pcchResult, DWORD dwReserved)
{
- CHECK_EXPECT(ParseUrl);
+ CHECK_EXPECT2(ParseUrl);
+
+ if(ParseAction == PARSE_SECURITY_URL) {
+ if(pcchResult)
+ *pcchResult = sizeof(url1)/sizeof(WCHAR);
+
+ if(cchResult<sizeof(url1)/sizeof(WCHAR))
+ return S_FALSE;
+
+ memcpy(pwzResult, url1, sizeof(url1));
+ return S_OK;
+ }
+
return E_NOTIMPL;
}
@@ -800,7 +837,7 @@
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void
**ppv)
{
if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
- CHECK_EXPECT(QI_IInternetProtocolInfo);
+ CHECK_EXPECT2(QI_IInternetProtocolInfo);
ok(iface == expect_cf, "unexpected iface\n");
*ppv = &protocol_info;
return qiret;
@@ -871,6 +908,7 @@
{
IInternetSession *session;
WCHAR buf[200];
+ LPWSTR sec_url;
DWORD size;
HRESULT hres;
@@ -914,6 +952,34 @@
hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
&size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
+
+ CHECK_CALLED(QI_IInternetProtocolInfo);
+ CHECK_CALLED(ParseUrl);
+
+ SET_EXPECT(QI_IInternetProtocolInfo);
+ SET_EXPECT(ParseUrl);
+
+ hres = CoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf,
+ sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
+ ok(size == sizeof(url1)/sizeof(WCHAR), "Size = %d\n", size);
+ if(size == sizeof(url1)/sizeof(WCHAR))
+ ok(!memcmp(buf, url1, sizeof(url1)), "Encoded url = %s\n",
wine_dbgstr_w(buf));
+
+ CHECK_CALLED(QI_IInternetProtocolInfo);
+ CHECK_CALLED(ParseUrl);
+
+ SET_EXPECT(QI_IInternetProtocolInfo);
+ SET_EXPECT(ParseUrl);
+
+ hres = CoInternetGetSecurityUrl(url8, &sec_url, PSU_SECURITY_URL_ONLY, 0);
+ ok(hres == S_OK, "CoInternetGetSecurityUrl failed: %08x\n", hres);
+ if(hres == S_OK) {
+ ok(lstrlenW(sec_url)>sizeof(wszFile)/sizeof(WCHAR) &&
+ !memcmp(sec_url, wszFile, sizeof(wszFile)-sizeof(WCHAR)),
+ "Encoded url = %s\n", wine_dbgstr_w(sec_url));
+ CoTaskMemFree(sec_url);
+ }
CHECK_CALLED(QI_IInternetProtocolInfo);
CHECK_CALLED(ParseUrl);
Modified: trunk/rostests/winetests/urlmon/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
==============================================================================
--- trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] Fri Mar 5 19:47:06 2010
@@ -131,7 +131,7 @@
static HRESULT expect_hrResult;
static LPCWSTR file_name, http_url, expect_wsz;
static IInternetProtocol *async_protocol = NULL;
-static BOOL first_data_notif, http_is_first, http_post_test;
+static BOOL first_data_notif, http_is_first, http_post_test, test_redirect;
static int state = 0, prot_state, read_report_data;
static DWORD bindf, ex_priority , pi;
static IInternetProtocol *binding_protocol, *filtered_protocol;
@@ -442,19 +442,23 @@
CLEAR_CALLED(ReportProgress_FINDINGRESOURCE);
CLEAR_CALLED(ReportProgress_CONNECTING);
CLEAR_CALLED(ReportProgress_PROXYDETECTING);
- } else todo_wine {
- CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE);
- /* IE7 does call this */
- CLEAR_CALLED(ReportProgress_CONNECTING);
- }
+ }else if(test_redirect) {
+ CHECK_CALLED(ReportProgress_FINDINGRESOURCE);
+ }else todo_wine {
+ CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE);
+ /* IE7 does call this */
+ CLEAR_CALLED(ReportProgress_CONNECTING);
+ }
}
if(tested_protocol == FTP_TEST)
todo_wine CHECK_CALLED(ReportProgress_SENDINGREQUEST);
else if (tested_protocol != HTTPS_TEST)
CHECK_CALLED(ReportProgress_SENDINGREQUEST);
+ if(test_redirect)
+ CHECK_CALLED(ReportProgress_REDIRECTING);
if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST) {
SET_EXPECT(OnResponse);
- if(tested_protocol == HTTPS_TEST)
+ if(tested_protocol == HTTPS_TEST || test_redirect)
SET_EXPECT(ReportProgress_ACCEPTRANGES);
SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
if(bindf & BINDF_NEEDFILE)
@@ -478,6 +482,8 @@
CHECK_CALLED(OnResponse);
if(tested_protocol == HTTPS_TEST)
CHECK_CALLED(ReportProgress_ACCEPTRANGES);
+ else if(test_redirect)
+ CLEAR_CALLED(ReportProgress_ACCEPTRANGES);
CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE);
if(bindf & BINDF_NEEDFILE)
CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
@@ -616,7 +622,10 @@
break;
case BINDSTATUS_REDIRECTING:
CHECK_EXPECT(ReportProgress_REDIRECTING);
- ok(szStatusText == NULL, "szStatusText = %s\n",
wine_dbgstr_w(szStatusText));
+ if(test_redirect)
+ ok(!strcmp_wa(szStatusText, "http://test.winehq.org/hello.html"),
"szStatusText = %s\n", wine_dbgstr_w(szStatusText));
+ else
+ ok(szStatusText == NULL, "szStatusText = %s\n",
wine_dbgstr_w(szStatusText));
break;
case BINDSTATUS_ENCODING:
CHECK_EXPECT(ReportProgress_ENCODING);
@@ -1346,6 +1355,7 @@
"GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres);
ok(fetched == 1, "fetched = %d, expected 1\n", fetched);
ok(!strcmp_ww(acc_mimeW, accept_mimes[0]), "unexpected mimes %s\n",
wine_dbgstr_w(accept_mimes[0]));
+ CoTaskMemFree(accept_mimes[0]);
hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider,
(void**)&service_provider);
@@ -1952,6 +1962,7 @@
#define TEST_POST 0x10
#define TEST_EMULATEPROT 0x20
#define TEST_SHORT_READ 0x40
+#define TEST_REDIRECT 0x80
static void init_test(int prot, DWORD flags)
{
@@ -1977,6 +1988,7 @@
emulate_prot = (flags & TEST_EMULATEPROT) != 0;
wait_for_switch = TRUE;
short_read = (flags & TEST_SHORT_READ) != 0;
+ test_redirect = (flags & TEST_REDIRECT) != 0;
}
static void test_priority(IInternetProtocol *protocol)
@@ -2429,6 +2441,8 @@
SET_EXPECT(ReportProgress_FINDINGRESOURCE);
SET_EXPECT(ReportProgress_CONNECTING);
SET_EXPECT(ReportProgress_SENDINGREQUEST);
+ if(test_redirect)
+ SET_EXPECT(ReportProgress_REDIRECTING);
SET_EXPECT(ReportProgress_PROXYDETECTING);
if(prot == HTTP_TEST)
SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE);
@@ -2516,6 +2530,9 @@
{'h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.',
'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m','/',
'p','o','s','t','t','e','s','t','.','p','h','p',0};
+ static const WCHAR redirect_url[] =
+
{'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/',
+
't','e','s','t','r','e','d','i','r','e','c','t',0};
trace("Testing http protocol (not from urlmon)...\n");
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
@@ -2538,6 +2555,10 @@
trace("Testing http protocol (direct read)...\n");
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON;
test_http_protocol_url(winehq_url, HTTP_TEST, TEST_DIRECT_READ);
+
+ trace("Testing http protocol (redirected)...\n");
+ bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON;
+ test_http_protocol_url(redirect_url, HTTP_TEST, TEST_REDIRECT);
}
static void test_https_protocol(void)
Modified: trunk/rostests/winetests/urlmon/sec_mgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/sec_mgr.…
==============================================================================
--- trunk/rostests/winetests/urlmon/sec_mgr.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/urlmon/sec_mgr.c [iso-8859-1] Fri Mar 5 19:47:06 2010
@@ -91,6 +91,15 @@
{url7, 3, S_OK, sizeof(secid7), secid7, S_OK}
};
+static int strcmp_w(const WCHAR *str1, const WCHAR *str2)
+{
+ DWORD len1 = lstrlenW(str1);
+ DWORD len2 = lstrlenW(str2);
+
+ if(len1!=len2) return 1;
+ return memcmp(str1, str2, len1*sizeof(WCHAR));
+}
+
static void test_SecurityManager(void)
{
int i;
@@ -605,11 +614,69 @@
ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
}
+static void test_InternetSecurityMarshalling(void)
+{
+ IInternetSecurityManager *secmgr = NULL;
+ IUnknown *unk;
+ IStream *stream;
+ HRESULT hres;
+
+ hres = CoInternetCreateSecurityManager(NULL, &secmgr, 0);
+ if(FAILED(hres))
+ return;
+
+ hres = IInternetSecurityManager_QueryInterface(secmgr, &IID_IUnknown,
(void**)&unk);
+ ok(hres == S_OK, "QueryInterface returned: %08x\n", hres);
+
+ hres = CreateStreamOnHGlobal(NULL, TRUE, &stream);
+ ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres);
+
+ hres = CoMarshalInterface(stream, &IID_IInternetSecurityManager, unk,
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
+ ok(hres == S_OK, "CoMarshalInterface returned: %08x\n", hres);
+
+ IStream_Release(stream);
+ IUnknown_Release(unk);
+ IInternetSecurityManager_Release(secmgr);
+}
+
+static void test_InternetGetSecurityUrl(void)
+{
+ const WCHAR url5_out[] =
{'h','t','t','p',':','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0};
+ const WCHAR url7_out[] =
{'f','t','p',':','w','i','n','e','h','q','.','o','r','g',0};
+
+ const WCHAR *in[] = {url2, url3, url4, url5, url7, url8, url9, url10};
+ const WCHAR *out_default[] = {url2, url3, url4, url5_out, url7_out, url8, url5_out,
url10};
+ const WCHAR *out_securl[] = {url2, url3, url4, url5, url7, url8, url9, url10};
+
+ WCHAR *sec;
+ DWORD i;
+ HRESULT hres;
+
+ for(i=0; i<sizeof(in)/sizeof(WCHAR*); i++) {
+ hres = CoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0);
+ ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i,
hres);
+ if(hres == S_OK) {
+ ok(!strcmp_w(sec, out_default[i]), "(%d) Got %s, expected %s\n",
+ i, wine_dbgstr_w(sec), wine_dbgstr_w(out_default[i]));
+ CoTaskMemFree(sec);
+ }
+
+ hres = CoInternetGetSecurityUrl(in[i], &sec, PSU_SECURITY_URL_ONLY, 0);
+ ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i,
hres);
+ if(hres == S_OK) {
+ ok(!strcmp_w(sec, out_securl[i]), "(%d) Got %s, expected %s\n",
+ i, wine_dbgstr_w(sec), wine_dbgstr_w(out_securl[i]));
+ CoTaskMemFree(sec);
+ }
+ }
+}
+
START_TEST(sec_mgr)
{
OleInitialize(NULL);
+ test_InternetGetSecurityUrl();
test_SecurityManager();
test_polices();
test_CoInternetCreateZoneManager();
@@ -617,6 +684,7 @@
test_GetZoneActionPolicy();
test_GetZoneAt();
test_GetZoneAttributes();
+ test_InternetSecurityMarshalling();
OleUninitialize();
}
Modified: trunk/rostests/winetests/urlmon/stream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/stream.c…
==============================================================================
--- trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] Fri Mar 5 19:47:06 2010
@@ -299,8 +299,11 @@
hr = URLOpenBlockingStreamW(NULL, NULL, &pStream, 0, &BindStatusCallback);
ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with
E_INVALIDARG instead of 0x%08x\n", hr);
- hr = URLOpenBlockingStreamW(NULL, INDEX_HTML, NULL, 0, &BindStatusCallback);
- ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with
E_INVALIDARG instead of 0x%08x\n", hr);
+ if (0) /* crashes on Win2k */
+ {
+ hr = URLOpenBlockingStreamW(NULL, INDEX_HTML, NULL, 0, &BindStatusCallback);
+ ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with
E_INVALIDARG instead of 0x%08x\n", hr);
+ }
SET_EXPECT(GetBindInfo);
SET_EXPECT(QueryInterface_IServiceProvider);
Modified: trunk/rostests/winetests/urlmon/url.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
==============================================================================
--- trunk/rostests/winetests/urlmon/url.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/urlmon/url.c [iso-8859-1] Fri Mar 5 19:47:06 2010
@@ -100,6 +100,7 @@
DEFINE_EXPECT(OnStartBinding);
DEFINE_EXPECT(OnProgress_FINDINGRESOURCE);
DEFINE_EXPECT(OnProgress_CONNECTING);
+DEFINE_EXPECT(OnProgress_REDIRECTING);
DEFINE_EXPECT(OnProgress_SENDINGREQUEST);
DEFINE_EXPECT(OnProgress_MIMETYPEAVAILABLE);
DEFINE_EXPECT(OnProgress_BEGINDOWNLOADDATA);
@@ -121,6 +122,7 @@
DEFINE_EXPECT(Obj_OnProgress_ENDSYNCOPERATION);
DEFINE_EXPECT(Obj_OnProgress_FINDINGRESOURCE);
DEFINE_EXPECT(Obj_OnProgress_CONNECTING);
+DEFINE_EXPECT(Obj_OnProgress_REDIRECTING);
DEFINE_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE);
DEFINE_EXPECT(Start);
DEFINE_EXPECT(Read);
@@ -181,6 +183,7 @@
static HANDLE complete_event, complete_event2;
static HRESULT binding_hres;
static BOOL have_IHttpNegotiate2, use_bscex;
+static BOOL test_redirect;
static LPCWSTR urls[] = {
WINE_ABOUT_URL,
@@ -380,12 +383,26 @@
SET_EXPECT(OnProgress_SENDINGREQUEST);
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
BINDSTATUS_SENDINGREQUEST, NULL);
- ok(hres == S_OK, "ReportProxgress failed: %08x\n", hres);
+ ok(hres == S_OK, "ReportProgress failed: %08x\n", hres);
WaitForSingleObject(complete_event, INFINITE);
if(bind_to_object)
CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST);
else
CHECK_CALLED(OnProgress_SENDINGREQUEST);
+
+ if(test_redirect) {
+ if(bind_to_object)
+ SET_EXPECT(Obj_OnProgress_REDIRECTING);
+ else
+ SET_EXPECT(OnProgress_REDIRECTING);
+ hres = IInternetProtocolSink_ReportProgress(protocol_sink,
BINDSTATUS_REDIRECTING, WINE_ABOUT_URL);
+ ok(hres == S_OK, "ReportProgress(BINDSTATUS_REFIRECTING) failed:
%08x\n", hres);
+ WaitForSingleObject(complete_event, INFINITE);
+ if(bind_to_object)
+ CHECK_CALLED(Obj_OnProgress_REDIRECTING);
+ else
+ CHECK_CALLED(OnProgress_REDIRECTING);
+ }
test_switch_fail();
@@ -773,7 +790,7 @@
IHttpNegotiate_Release(http_negotiate);
ok(hres == S_OK, "OnResponse failed: %08x\n", hres);
- if(test_protocol == HTTPS_TEST) {
+ if(test_protocol == HTTPS_TEST || test_redirect) {
hres = IInternetProtocolSink_ReportProgress(protocol_sink,
BINDSTATUS_ACCEPTRANGES, NULL);
ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed:
%08x\n", hres);
}
@@ -1273,6 +1290,16 @@
else
CHECK_EXPECT(OnProgress_CONNECTING);
if((bindf & BINDF_ASYNCHRONOUS) && emulate_protocol)
+ SetEvent(complete_event);
+ break;
+ case BINDSTATUS_REDIRECTING:
+ if(iface == &objbsc)
+ CHECK_EXPECT(Obj_OnProgress_REDIRECTING);
+ else
+ CHECK_EXPECT(OnProgress_REDIRECTING);
+ ok(!lstrcmpW(szStatusText, WINE_ABOUT_URL), "unexpected status text
%s\n",
+ wine_dbgstr_w(szStatusText));
+ if(!bind_to_object || iface == &objbsc)
SetEvent(complete_event);
break;
case BINDSTATUS_SENDINGREQUEST:
@@ -1700,6 +1727,8 @@
SET_EXPECT(QueryInterface_IBindStatusCallbackEx);
SET_EXPECT(GetBindInfo);
SET_EXPECT(OnStartBinding);
+ if(test_redirect)
+ SET_EXPECT(OnProgress_REDIRECTING);
SET_EXPECT(OnProgress_BEGINDOWNLOADDATA);
if(test_protocol == FILE_TEST)
SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE);
@@ -1716,6 +1745,8 @@
CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */
CHECK_CALLED(GetBindInfo);
CHECK_CALLED(OnStartBinding);
+ if(test_redirect)
+ CHECK_CALLED(OnProgress_REDIRECTING);
CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA);
if(test_protocol == FILE_TEST)
CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE);
@@ -2184,9 +2215,11 @@
return ret;
}
-#define BINDTEST_EMULATE 1
-#define BINDTEST_TOOBJECT 2
-#define BINDTEST_FILEDWLAPI 4
+#define BINDTEST_EMULATE 0x0001
+#define BINDTEST_TOOBJECT 0x0002
+#define BINDTEST_FILEDWLAPI 0x0004
+#define BINDTEST_HTTPRESPONSE 0x0008
+#define BINDTEST_REDIRECT 0x0010
static void init_bind_test(int protocol, DWORD flags, DWORD t)
{
@@ -2201,9 +2234,14 @@
bind_to_object = (flags & BINDTEST_TOOBJECT) != 0;
tymed = t;
filedwl_api = (flags & BINDTEST_FILEDWLAPI) != 0;
-}
-
-static void test_BindToStorage(int protocol, BOOL emul, DWORD t)
+ if(flags & BINDTEST_HTTPRESPONSE)
+ urls[HTTP_TEST] = SHORT_RESPONSE_URL;
+ else
+ urls[HTTP_TEST] = WINE_ABOUT_URL;
+ test_redirect = (flags & BINDTEST_REDIRECT) != 0;
+}
+
+static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
{
IMoniker *mon;
HRESULT hres;
@@ -2214,7 +2252,7 @@
IUnknown *unk = (IUnknown*)0x00ff00ff;
IBinding *bind;
- init_bind_test(protocol, emul ? BINDTEST_EMULATE : 0, t);
+ init_bind_test(protocol, flags, t);
SET_EXPECT(QueryInterface_IServiceProvider);
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
@@ -2396,7 +2434,7 @@
http_is_first = FALSE;
}
-static void test_BindToObject(int protocol, BOOL emul)
+static void test_BindToObject(int protocol, DWORD flags)
{
IMoniker *mon;
HRESULT hres;
@@ -2407,9 +2445,9 @@
IUnknown *unk = (IUnknown*)0x00ff00ff;
IBinding *bind;
- init_bind_test(protocol, BINDTEST_TOOBJECT | (emul ? BINDTEST_EMULATE : 0),
TYMED_ISTREAM);
-
- if(emul)
+ init_bind_test(protocol, BINDTEST_TOOBJECT|flags, TYMED_ISTREAM);
+
+ if(emulate_protocol)
CoRegisterClassObject(&CLSID_HTMLDocument, (IUnknown *)&mime_cf,
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®id);
@@ -2500,14 +2538,14 @@
}else {
ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres);
ok(unk != NULL, "unk == NULL\n");
- if(emul)
+ if(emulate_protocol)
ok(unk == (IUnknown*)&PersistMoniker, "unk !=
PersistMoniker\n");
}
if(unk)
IUnknown_Release(unk);
while((bindf & BINDF_ASYNCHRONOUS) &&
- !((!emul || stopped_binding) && stopped_obj_binding) &&
GetMessage(&msg,NULL,0,0)) {
+ !((!emulate_protocol || stopped_binding) && stopped_obj_binding)
&& GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -2571,7 +2609,7 @@
CHECK_CALLED(Obj_OnStopBinding);
}
- if(test_protocol != HTTP_TEST || emul || urls[test_protocol] == SHORT_RESPONSE_URL ||
!(bindf & BINDF_ASYNCHRONOUS)) {
+ if(test_protocol != HTTP_TEST || emulate_protocol || !(bindf &
BINDF_ASYNCHRONOUS)) {
ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n");
}else {
@@ -2579,7 +2617,7 @@
IBindCtx_Release(bctx);
}
- if(emul)
+ if(emulate_protocol)
CoRevokeClassObject(regid);
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST)
@@ -2612,6 +2650,7 @@
SET_EXPECT(QueryInterface_IHttpNegotiate2);
SET_EXPECT(GetRootSecurityId);
SET_EXPECT(QueryInterface_IWindowForBindingUI);
+ SET_EXPECT(OnProgress_CONNECTING);
}
if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol ==
FILE_TEST)
SET_EXPECT(OnProgress_SENDINGREQUEST);
@@ -2655,6 +2694,7 @@
CHECK_CALLED(GetRootSecurityId);
}
CLEAR_CALLED(QueryInterface_IWindowForBindingUI);
+ CLEAR_CALLED(OnProgress_CONNECTING);
}
if(test_protocol == FILE_TEST)
CHECK_CALLED(OnProgress_SENDINGREQUEST);
@@ -2821,40 +2861,8 @@
IMoniker_Release(mon);
}
-static void gecko_installer_workaround(BOOL disable)
-{
- HKEY hkey;
- DWORD res;
-
- static BOOL has_url = FALSE;
- static char url[2048];
-
- if(!disable && !has_url)
- return;
-
- res = RegOpenKey(HKEY_CURRENT_USER, "Software\\Wine\\MSHTML", &hkey);
- if(res != ERROR_SUCCESS)
- return;
-
- if(disable) {
- DWORD type, size = sizeof(url);
-
- res = RegQueryValueEx(hkey, "GeckoUrl", NULL, &type, (PVOID)url,
&size);
- if(res == ERROR_SUCCESS && type == REG_SZ)
- has_url = TRUE;
-
- RegDeleteValue(hkey, "GeckoUrl");
- }else {
- RegSetValueEx(hkey, "GeckoUrl", 0, REG_SZ, (PVOID)url,
lstrlenA(url)+1);
- }
-
- RegCloseKey(hkey);
-}
-
START_TEST(url)
{
- gecko_installer_workaround(TRUE);
-
complete_event = CreateEvent(NULL, FALSE, FALSE, NULL);
complete_event2 = CreateEvent(NULL, FALSE, FALSE, NULL);
thread_id = GetCurrentThreadId();
@@ -2874,7 +2882,7 @@
test_BindToStorage_fail();
trace("synchronous http test (COM not initialised)...\n");
- test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
CoInitialize(NULL);
@@ -2882,95 +2890,100 @@
test_StdURLMoniker();
trace("synchronous http test...\n");
- test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
trace("synchronous http test (to object)...\n");
- test_BindToObject(HTTP_TEST, FALSE);
+ test_BindToObject(HTTP_TEST, 0);
trace("synchronous file test...\n");
- test_BindToStorage(FILE_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
trace("synchronous file test (to object)...\n");
- test_BindToObject(FILE_TEST, FALSE);
+ test_BindToObject(FILE_TEST, 0);
bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
trace("http test...\n");
- test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM);
trace("http test (to file)...\n");
- test_BindToStorage(HTTP_TEST, FALSE, TYMED_FILE);
+ test_BindToStorage(HTTP_TEST, 0, TYMED_FILE);
trace("http test (to object)...\n");
- test_BindToObject(HTTP_TEST, FALSE);
+ test_BindToObject(HTTP_TEST, 0);
trace("http test (short response)...\n");
http_is_first = TRUE;
- urls[HTTP_TEST] = SHORT_RESPONSE_URL;
- test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE, TYMED_ISTREAM);
trace("http test (short response, to object)...\n");
- test_BindToObject(HTTP_TEST, FALSE);
+ test_BindToObject(HTTP_TEST, 0);
trace("emulated http test...\n");
- test_BindToStorage(HTTP_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("emulated http test (to object)...\n");
- test_BindToObject(HTTP_TEST, TRUE);
+ test_BindToObject(HTTP_TEST, BINDTEST_EMULATE);
+
+ trace("emulated http test (to object, redirect)...\n");
+ test_BindToObject(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT);
trace("emulated http test (to file)...\n");
- test_BindToStorage(HTTP_TEST, TRUE, TYMED_FILE);
+ test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE);
+
+ trace("emulated http test (redirect)...\n");
+ test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT,
TYMED_ISTREAM);
trace("asynchronous https test...\n");
- test_BindToStorage(HTTPS_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM);
trace("emulated https test...\n");
- test_BindToStorage(HTTPS_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("about test...\n");
- test_BindToStorage(ABOUT_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM);
trace("about test (to file)...\n");
- test_BindToStorage(ABOUT_TEST, FALSE, TYMED_FILE);
+ test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE);
trace("about test (to object)...\n");
- test_BindToObject(ABOUT_TEST, FALSE);
+ test_BindToObject(ABOUT_TEST, 0);
trace("emulated about test...\n");
- test_BindToStorage(ABOUT_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("emulated about test (to file)...\n");
- test_BindToStorage(ABOUT_TEST, TRUE, TYMED_FILE);
+ test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_FILE);
trace("emulated about test (to object)...\n");
- test_BindToObject(ABOUT_TEST, TRUE);
+ test_BindToObject(ABOUT_TEST, BINDTEST_EMULATE);
trace("file test...\n");
- test_BindToStorage(FILE_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM);
trace("file test (to file)...\n");
- test_BindToStorage(FILE_TEST, FALSE, TYMED_FILE);
+ test_BindToStorage(FILE_TEST, 0, TYMED_FILE);
trace("file test (to object)...\n");
- test_BindToObject(FILE_TEST, FALSE);
+ test_BindToObject(FILE_TEST, 0);
trace("emulated file test...\n");
- test_BindToStorage(FILE_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("emulated file test (to file)...\n");
- test_BindToStorage(FILE_TEST, TRUE, TYMED_FILE);
+ test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE);
trace("emulated file test (to object)...\n");
- test_BindToObject(FILE_TEST, TRUE);
+ test_BindToObject(FILE_TEST, BINDTEST_EMULATE);
trace("emulated its test...\n");
- test_BindToStorage(ITS_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("emulated its test (to file)...\n");
- test_BindToStorage(ITS_TEST, TRUE, TYMED_FILE);
+ test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_FILE);
trace("emulated mk test...\n");
- test_BindToStorage(MK_TEST, TRUE, TYMED_ISTREAM);
+ test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM);
trace("test URLDownloadToFile for file protocol...\n");
test_URLDownloadToFile(FILE_TEST, FALSE);
@@ -2984,7 +2997,7 @@
bindf |= BINDF_NOWRITECACHE;
trace("ftp test...\n");
- test_BindToStorage(FTP_TEST, FALSE, TYMED_ISTREAM);
+ test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM);
trace("test failures...\n");
test_BindToStorage_fail();
@@ -2994,6 +3007,4 @@
CloseHandle(complete_event);
CloseHandle(complete_event2);
CoUninitialize();
-
- gecko_installer_workaround(FALSE);
-}
+}