urlmon/tests: Fix http_protocol tests to succeed on Win98.

This commit is contained in:
Misha Koshelev 2007-07-18 19:58:32 -05:00 committed by Alexandre Julliard
parent c2534d0cd6
commit e2726effe2
1 changed files with 13 additions and 11 deletions

View File

@ -54,6 +54,9 @@
expect_ ## func = called_ ## func = FALSE; \ expect_ ## func = called_ ## func = FALSE; \
}while(0) }while(0)
#define CLEAR_CALLED(func) \
expect_ ## func = called_ ## func = FALSE
DEFINE_EXPECT(GetBindInfo); DEFINE_EXPECT(GetBindInfo);
DEFINE_EXPECT(ReportProgress_MIMETYPEAVAILABLE); DEFINE_EXPECT(ReportProgress_MIMETYPEAVAILABLE);
DEFINE_EXPECT(ReportProgress_DIRECTBIND); DEFINE_EXPECT(ReportProgress_DIRECTBIND);
@ -246,7 +249,7 @@ static HRESULT WINAPI ProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOL
{ {
CHECK_EXPECT2(Switch); CHECK_EXPECT2(Switch);
ok(pProtocolData != NULL, "pProtocolData == NULL\n"); ok(pProtocolData != NULL, "pProtocolData == NULL\n");
SendMessageW(protocol_hwnd, WM_USER, 0, (LPARAM)pProtocolData); SendMessage(protocol_hwnd, WM_USER, 0, (LPARAM)pProtocolData);
return S_OK; return S_OK;
} }
@ -1066,7 +1069,8 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first)
CHECK_CALLED(GetBindString_ACCEPT_MIMES); CHECK_CALLED(GetBindString_ACCEPT_MIMES);
CHECK_CALLED(QueryService_HttpNegotiate); CHECK_CALLED(QueryService_HttpNegotiate);
CHECK_CALLED(BeginningTransaction); CHECK_CALLED(BeginningTransaction);
CHECK_CALLED(GetRootSecurityId); /* GetRootSecurityId called on WinXP but not on Win98 */
CLEAR_CALLED(GetRootSecurityId);
return TRUE; return TRUE;
} }
@ -1125,7 +1129,7 @@ static void test_http_protocol_url(LPCWSTR url)
SET_EXPECT(ReportResult); SET_EXPECT(ReportResult);
expect_hrResult = S_OK; expect_hrResult = S_OK;
GetMessageW(&msg, NULL, 0, 0); GetMessage(&msg, NULL, 0, 0);
CHECK_CALLED(Switch); CHECK_CALLED(Switch);
CHECK_CALLED(ReportResult); CHECK_CALLED(ReportResult);
@ -1179,7 +1183,7 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
ok(hres == S_FALSE || hres == E_PENDING, "Read failed: %08x\n", hres); ok(hres == S_FALSE || hres == E_PENDING, "Read failed: %08x\n", hres);
if(hres == S_FALSE) if(hres == S_FALSE)
PostMessageW(protocol_hwnd, WM_USER+1, 0, 0); PostMessage(protocol_hwnd, WM_USER+1, 0, 0);
if(!state) { if(!state) {
state = 1; state = 1;
@ -1198,19 +1202,17 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
static HWND create_protocol_window(void) static HWND create_protocol_window(void)
{ {
static const WCHAR wszProtocolWindow[] = static WNDCLASSEX wndclass = {
{'P','r','o','t','o','c','o','l','W','i','n','d','o','w',0}; sizeof(WNDCLASSEX),
static WNDCLASSEXW wndclass = {
sizeof(WNDCLASSEXW),
0, 0,
wnd_proc, wnd_proc,
0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL,
wszProtocolWindow, "ProtocolWindow",
NULL NULL
}; };
RegisterClassExW(&wndclass); RegisterClassEx(&wndclass);
return CreateWindowW(wszProtocolWindow, wszProtocolWindow, return CreateWindow("ProtocolWindow", "ProtocolWindow",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, NULL, NULL, NULL, NULL); CW_USEDEFAULT, NULL, NULL, NULL, NULL);
} }