Commit 9b6881a5 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

ieframe: Test setting different client site in OleObject_SetClientSite.

parent 3fbd56b0
...@@ -1123,6 +1123,7 @@ static const IOleClientSiteVtbl ClientSiteVtbl = { ...@@ -1123,6 +1123,7 @@ static const IOleClientSiteVtbl ClientSiteVtbl = {
}; };
static IOleClientSite ClientSite = { &ClientSiteVtbl }; static IOleClientSite ClientSite = { &ClientSiteVtbl };
static IOleClientSite ClientSite2 = { &ClientSiteVtbl };
static HRESULT WINAPI IOleControlSite_fnQueryInterface(IOleControlSite *iface, REFIID riid, void **ppv) static HRESULT WINAPI IOleControlSite_fnQueryInterface(IOleControlSite *iface, REFIID riid, void **ppv)
{ {
...@@ -2030,6 +2031,61 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop ...@@ -2030,6 +2031,61 @@ static void test_ClientSite(IWebBrowser2 *unk, IOleClientSite *client, BOOL stop
IOleObject_Release(oleobj); IOleObject_Release(oleobj);
} }
static void test_change_ClientSite(IWebBrowser2 *unk)
{
BOOL old_use_container_olecmd = use_container_olecmd;
IOleClientSite *doc_clientsite;
IOleInPlaceObject *inplace;
IOleCommandTarget *olecmd;
IOleObject *oleobj;
HRESULT hres;
HWND hwnd;
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres);
if(FAILED(hres))
return;
use_container_olecmd = FALSE;
SET_EXPECT(Site_GetWindow);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Invoke_AMBIENT_SILENT);
hres = IOleObject_SetClientSite(oleobj, &ClientSite2);
ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
IOleObject_Release(oleobj);
CHECK_CALLED(Site_GetWindow);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Invoke_AMBIENT_SILENT);
doc_clientsite = get_dochost(unk);
hres = IOleClientSite_QueryInterface(doc_clientsite, &IID_IOleCommandTarget, (void**)&olecmd);
ok(hres == S_OK, "QueryInterface(IOleCommandTarget) failed: %08x\n", hres);
IOleClientSite_Release(doc_clientsite);
hres = IWebBrowser2_QueryInterface(unk, &IID_IOleInPlaceObject, (void**)&inplace);
ok(hres == S_OK, "QueryInterface(OleInPlaceObject) failed: %08x\n", hres);
hres = IOleInPlaceObject_GetWindow(inplace, &hwnd);
ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
ok(hwnd == shell_embedding_hwnd, "unexpected hwnd %p\n", hwnd);
IOleInPlaceObject_Release(inplace);
if(old_use_container_olecmd) {
SET_EXPECT(Exec_UPDATECOMMANDS);
hres = IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_UPDATECOMMANDS,
OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
ok(hres == S_OK, "Exec(OLECMDID_UPDATECOMMAND) failed: %08x\n", hres);
CHECK_CALLED(Exec_UPDATECOMMANDS);
use_container_olecmd = TRUE;
}
IOleCommandTarget_Release(olecmd);
}
static void test_ClassInfo(IWebBrowser2 *unk) static void test_ClassInfo(IWebBrowser2 *unk)
{ {
IProvideClassInfo2 *class_info; IProvideClassInfo2 *class_info;
...@@ -3777,10 +3833,12 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) ...@@ -3777,10 +3833,12 @@ static void test_WebBrowser(DWORD flags, BOOL do_close)
test_external(webbrowser); test_external(webbrowser);
test_htmlwindow_close(webbrowser); test_htmlwindow_close(webbrowser);
if(do_close) if(do_close) {
test_Close(webbrowser, do_download); test_Close(webbrowser, do_download);
else }else {
test_change_ClientSite(webbrowser);
test_ClientSite(webbrowser, NULL, !do_download); test_ClientSite(webbrowser, NULL, !do_download);
}
test_ie_funcs(webbrowser); test_ie_funcs(webbrowser);
test_GetControlInfo(webbrowser); test_GetControlInfo(webbrowser);
test_wb_funcs(webbrowser, FALSE); test_wb_funcs(webbrowser, FALSE);
......
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