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

mshtml: Fixed protocol tests on IE7.

parent 6e58579e
...@@ -584,9 +584,9 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -584,9 +584,9 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) { if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) {
WARN("Wrong protocol of url: %s\n", debugstr_w(url)); WARN("Wrong protocol of url: %s\n", debugstr_w(url));
IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, E_INVALIDARG, 0, NULL);
mshtml_free(url); mshtml_free(url);
return MK_E_SYNTAX; return E_INVALIDARG;
} }
url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]); url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]);
...@@ -803,11 +803,11 @@ static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC ...@@ -803,11 +803,11 @@ static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC
static const WCHAR wszRes[] = {'r','e','s',':','/','/'}; static const WCHAR wszRes[] = {'r','e','s',':','/','/'};
if(strlenW(pwzUrl) <= sizeof(wszRes)/sizeof(WCHAR) || memcmp(pwzUrl, wszRes, sizeof(wszRes))) if(strlenW(pwzUrl) <= sizeof(wszRes)/sizeof(WCHAR) || memcmp(pwzUrl, wszRes, sizeof(wszRes)))
return MK_E_SYNTAX; return E_INVALIDARG;
ptr = strchrW(pwzUrl + sizeof(wszRes)/sizeof(WCHAR), '/'); ptr = strchrW(pwzUrl + sizeof(wszRes)/sizeof(WCHAR), '/');
if(!ptr) if(!ptr)
return MK_E_SYNTAX; return E_INVALIDARG;
size = ptr-pwzUrl + sizeof(wszFile)/sizeof(WCHAR) - sizeof(wszRes)/sizeof(WCHAR); size = ptr-pwzUrl + sizeof(wszFile)/sizeof(WCHAR) - sizeof(wszRes)/sizeof(WCHAR);
if(size >= cchResult) if(size >= cchResult)
......
...@@ -126,7 +126,9 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR ...@@ -126,7 +126,9 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR
ok((hrResult&0xffff0000) == ((FACILITY_WIN32 << 16)|0x80000000) || expect_hrResult, ok((hrResult&0xffff0000) == ((FACILITY_WIN32 << 16)|0x80000000) || expect_hrResult,
"expected win32 err or %08x got: %08x\n", expect_hrResult, hrResult); "expected win32 err or %08x got: %08x\n", expect_hrResult, hrResult);
else else
ok(hrResult == expect_hrResult, "expected: %08x got: %08x\n", expect_hrResult, hrResult); ok(hrResult == expect_hrResult || ((expect_hrResult == E_INVALIDARG ||
expect_hrResult == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND)) &&
hrResult == MK_E_SYNTAX), "expected: %08x got: %08x\n", expect_hrResult, hrResult);
ok(dwError == 0, "dwError = %d\n", dwError); ok(dwError == 0, "dwError = %d\n", dwError);
ok(!szResult, "szResult != NULL\n"); ok(!szResult, "szResult != NULL\n");
...@@ -213,7 +215,9 @@ static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT ...@@ -213,7 +215,9 @@ static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT
ok((hres&0xffff0000) == ((FACILITY_WIN32 << 16)|0x80000000) || hres == expect_hrResult, ok((hres&0xffff0000) == ((FACILITY_WIN32 << 16)|0x80000000) || hres == expect_hrResult,
"expected win32 err or %08x got: %08x\n", expected_hres, hres); "expected win32 err or %08x got: %08x\n", expected_hres, hres);
else else
ok(hres == expected_hres, "expected: %08x got: %08x\n", expected_hres, hres); ok(hres == expected_hres || ((expected_hres == E_INVALIDARG ||
expected_hres == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND)) && hres == MK_E_SYNTAX),
"expected: %08x got: %08x\n", expected_hres, hres);
CHECK_CALLED(GetBindInfo); CHECK_CALLED(GetBindInfo);
CHECK_CALLED(ReportResult); CHECK_CALLED(ReportResult);
...@@ -290,7 +294,8 @@ static void test_res_protocol(void) ...@@ -290,7 +294,8 @@ static void test_res_protocol(void)
hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_SECURITY_URL, 0, buf, hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_SECURITY_URL, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0); sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres); ok(hres == MK_E_SYNTAX || hres == E_INVALIDARG,
"ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres);
size = 0xdeadbeef; size = 0xdeadbeef;
buf[0] = '?'; buf[0] = '?';
...@@ -375,8 +380,9 @@ static void test_res_protocol(void) ...@@ -375,8 +380,9 @@ static void test_res_protocol(void)
ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres); ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
test_protocol_fail(protocol, wrong_url1, MK_E_SYNTAX, FALSE); test_protocol_fail(protocol, wrong_url1, E_INVALIDARG, FALSE);
test_protocol_fail(protocol, wrong_url2, MK_E_SYNTAX, FALSE); test_protocol_fail(protocol, wrong_url2,
HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), FALSE);
test_protocol_fail(protocol, wrong_url3, E_FAIL, TRUE); test_protocol_fail(protocol, wrong_url3, E_FAIL, TRUE);
test_protocol_fail(protocol, wrong_url4, E_FAIL, TRUE); test_protocol_fail(protocol, wrong_url4, E_FAIL, TRUE);
......
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