From f123b6a78fdb322ab3499923c06b015661ebde35 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 11 May 2011 11:34:47 +0000 Subject: [PATCH] urlmon: Code clean up and make tests a bit stricker. --- dlls/urlmon/tests/protocol.c | 17 ++++++----------- dlls/urlmon/tests/url.c | 17 +++++++---------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 615c8953e41..4ca6da1cf20 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -570,15 +570,11 @@ static void call_continue(PROTOCOLDATA *protocol_data) if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST) CLEAR_CALLED(ReportProgress_COOKIE_SENT); if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST || tested_protocol == FTP_TEST) { - if (http_is_first) { + if (http_is_first){ CLEAR_CALLED(ReportProgress_FINDINGRESOURCE); - CLEAR_CALLED(ReportProgress_CONNECTING); CLEAR_CALLED(ReportProgress_PROXYDETECTING); - }else { - CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); - /* IE7 does call this */ - CLEAR_CALLED(ReportProgress_CONNECTING); } + CLEAR_CALLED(ReportProgress_CONNECTING); } if(tested_protocol == FTP_TEST) todo_wine CHECK_CALLED(ReportProgress_SENDINGREQUEST); @@ -926,9 +922,6 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR if(http_is_first) { CHECK_CALLED(ReportProgress_FINDINGRESOURCE); CHECK_CALLED(ReportProgress_CONNECTING); - } else todo_wine { - CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); - CHECK_NOT_CALLED(ReportProgress_CONNECTING); } CHECK_CALLED(ReportProgress_SENDINGREQUEST); CHECK_CALLED(OnResponse); @@ -2761,8 +2754,10 @@ static void test_http_protocol_url(LPCWSTR url, int prot, DWORD flags, DWORD tym test_http_info(async_protocol); SET_EXPECT(ReportProgress_COOKIE_SENT); - SET_EXPECT(ReportProgress_FINDINGRESOURCE); - SET_EXPECT(ReportProgress_CONNECTING); + if(http_is_first) { + SET_EXPECT(ReportProgress_FINDINGRESOURCE); + SET_EXPECT(ReportProgress_CONNECTING); + } SET_EXPECT(ReportProgress_SENDINGREQUEST); if(test_redirect) SET_EXPECT(ReportProgress_REDIRECTING); diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 0f588b80bbf..7c74865870a 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -1592,8 +1592,6 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u CHECK_EXPECT(Obj_OnProgress_FINDINGRESOURCE); else if(test_protocol == FTP_TEST) todo_wine CHECK_EXPECT(OnProgress_FINDINGRESOURCE); - else if(onsecurityproblem_hres == S_OK) - CHECK_EXPECT2(OnProgress_FINDINGRESOURCE); /* todo wine */ else CHECK_EXPECT(OnProgress_FINDINGRESOURCE); if(emulate_protocol && (test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == WINETEST_TEST)) @@ -1721,10 +1719,8 @@ static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallbackEx *iface, ULONG u HRESULT hr; if(iface != &objbsc) ok(0, "unexpected call\n"); - else if(1||emulate_protocol) - CHECK_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE); else - todo_wine CHECK_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE); + CHECK_EXPECT(Obj_OnProgress_CLASSIDAVAILABLE); hr = CLSIDFromString((LPCOLESTR)szStatusText, &clsid); ok(hr == S_OK, "CLSIDFromString failed with error 0x%08x\n", hr); ok(IsEqualCLSID(&clsid, &CLSID_HTMLDocument), @@ -2806,7 +2802,8 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) SET_EXPECT(BeginningTransaction); SET_EXPECT(QueryInterface_IHttpNegotiate2); SET_EXPECT(GetRootSecurityId); - SET_EXPECT(OnProgress_FINDINGRESOURCE); + if(http_is_first) + SET_EXPECT(OnProgress_FINDINGRESOURCE); SET_EXPECT(OnProgress_CONNECTING); } if(flags & BINDTEST_INVALID_CN) { @@ -2944,7 +2941,7 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) CHECK_CALLED(QueryInterface_IHttpNegotiate2); CHECK_CALLED(GetRootSecurityId); } - if(http_is_first || (test_protocol == HTTPS_TEST && !(flags & BINDTEST_INVALID_CN))) { + if(http_is_first) { if (! proxy_active()) { CHECK_CALLED(OnProgress_FINDINGRESOURCE); @@ -2956,7 +2953,6 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t) CLEAR_CALLED(OnProgress_CONNECTING); } }else if(!abort_start) { - CHECK_NOT_CALLED(OnProgress_FINDINGRESOURCE); /* IE7 does call this */ CLEAR_CALLED(OnProgress_CONNECTING); } @@ -3099,7 +3095,8 @@ static void test_BindToObject(int protocol, DWORD flags) SET_EXPECT(BeginningTransaction); SET_EXPECT(QueryInterface_IHttpNegotiate2); SET_EXPECT(GetRootSecurityId); - SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE); + if(http_is_first) + SET_EXPECT(Obj_OnProgress_FINDINGRESOURCE); SET_EXPECT(Obj_OnProgress_CONNECTING); SET_EXPECT(QueryInterface_IWindowForBindingUI); SET_EXPECT(QueryService_IWindowForBindingUI); @@ -3183,7 +3180,6 @@ static void test_BindToObject(int protocol, DWORD flags) CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE); CHECK_CALLED(Obj_OnProgress_CONNECTING); }else { - CHECK_NOT_CALLED(Obj_OnProgress_FINDINGRESOURCE); /* IE7 does call this */ CLEAR_CALLED(Obj_OnProgress_CONNECTING); } @@ -3666,6 +3662,7 @@ START_TEST(url) test_BindToStorage(WINETEST_TEST, BINDTEST_EMULATE|BINDTEST_NO_CALLBACK|BINDTEST_USE_CACHE, TYMED_ISTREAM); trace("asynchronous https test...\n"); + http_is_first = TRUE; test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); trace("emulated https test...\n");