From 260df18a31ee8f82975fde05b01b212364c62391 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 15 Aug 2005 20:50:41 +0000 Subject: [PATCH] - Code cleanup. - Dissable tests after UIActivate failes (fixes tests win 9x). --- dlls/mshtml/tests/htmldoc.c | 654 +++++++++++++++++------------------- 1 file changed, 307 insertions(+), 347 deletions(-) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index eb4edeafa6..01e4c64adc 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -43,7 +43,6 @@ ok(called_ ## func, "expected " #func "\n"); \ expect_ ## func = called_ ## func = FALSE -static IUnknown *htmldoc_unk = NULL; static IOleDocumentView *view = NULL; static HWND container_hwnd = NULL, hwnd = NULL, last_hwnd = NULL; @@ -469,7 +468,7 @@ static HRESULT WINAPI DocumentSite_ActivateMe(IOleDocumentSite *iface, IOleDocum CHECK_EXPECT(ActivateMe); ok(pViewToActivate != NULL, "pViewToActivate = NULL\n"); - hres = IUnknown_QueryInterface(htmldoc_unk, &IID_IOleDocument, (void**)&document); + hres = IOleDocumentView_QueryInterface(pViewToActivate, &IID_IOleDocument, (void**)&document); ok(hres == S_OK, "could not get IOleDocument: %08lx\n", hres); if(SUCCEEDED(hres)) { @@ -513,8 +512,15 @@ static HRESULT WINAPI DocumentSite_ActivateMe(IOleDocumentSite *iface, IOleDocum SET_EXPECT(SetActiveObject); SET_EXPECT(ShowUI); expect_SetActiveObject_active = TRUE; + hres = IOleDocumentView_UIActivate(view, TRUE); + + if(FAILED(hres)) { + trace("UIActivate failed: %08lx\n", hres); + return hres; + } ok(hres == S_OK, "UIActivate failed: %08lx\n", hres); + CHECK_CALLED(CanInPlaceActivate); CHECK_CALLED(GetWindowContext); CHECK_CALLED(GetWindow); @@ -796,14 +802,14 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return DefWindowProc(hwnd, msg, wParam, lParam); } -static void test_Persist() +static void test_Persist(IUnknown *unk) { IPersistMoniker *persist_mon; IPersistFile *persist_file; GUID guid; HRESULT hres; - hres = IUnknown_QueryInterface(htmldoc_unk, &IID_IPersistFile, (void**)&persist_file); + hres = IUnknown_QueryInterface(unk, &IID_IPersistFile, (void**)&persist_file); ok(hres == S_OK, "QueryInterface(IID_IPersist) failed: %08lx\n", hres); if(SUCCEEDED(hres)) { hres = IPersist_GetClassID(persist_file, NULL); @@ -816,7 +822,7 @@ static void test_Persist() IPersist_Release(persist_file); } - hres = IUnknown_QueryInterface(htmldoc_unk, &IID_IPersistMoniker, (void**)&persist_mon); + hres = IUnknown_QueryInterface(unk, &IID_IPersistMoniker, (void**)&persist_mon); ok(hres == S_OK, "QueryInterface(IID_IPersistMoniker) failed: %08lx\n", hres); if(SUCCEEDED(hres)) { hres = IPersistMoniker_GetClassID(persist_mon, NULL); @@ -872,12 +878,18 @@ static const OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = { OLECMDF_SUPPORTED /* OLECMDID_GETPRINTTEMPLATE */ }; -static void test_OleCommandTarget(IOleCommandTarget *cmdtrg) +static void test_OleCommandTarget(IUnknown *unk) { + IOleCommandTarget *cmdtrg; OLECMD cmds[OLECMDID_GETPRINTTEMPLATE]; int i; HRESULT hres; + hres = IUnknown_QueryInterface(unk, &IID_IOleCommandTarget, (void**)&cmdtrg); + ok(hres == S_OK, "QueryInterface(IIDIOleM=CommandTarget failed: %08lx\n", hres); + if(FAILED(hres)) + return; + for(i=0; i