2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <wine/test.h>
39 #include "shdeprecated.h"
44 #include "docobjectservice.h"
46 DEFINE_GUID(GUID_NULL
,0,0,0,0,0,0,0,0,0,0,0);
47 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
49 #define DEFINE_EXPECT(func) \
50 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
52 #define SET_EXPECT(func) \
53 expect_ ## func = TRUE
55 #define CHECK_EXPECT2(func) \
57 ok(expect_ ##func, "unexpected call " #func "\n"); \
58 called_ ## func = TRUE; \
61 #define CHECK_EXPECT(func) \
63 CHECK_EXPECT2(func); \
64 expect_ ## func = FALSE; \
67 #define CHECK_CALLED(func) \
69 ok(called_ ## func, "expected " #func "\n"); \
70 expect_ ## func = called_ ## func = FALSE; \
73 #define CLEAR_CALLED(func) \
74 expect_ ## func = called_ ## func = FALSE
76 DEFINE_EXPECT(GetContainer
);
77 DEFINE_EXPECT(Site_GetWindow
);
78 DEFINE_EXPECT(ShowObject
);
79 DEFINE_EXPECT(CanInPlaceActivate
);
80 DEFINE_EXPECT(OnInPlaceActivate
);
81 DEFINE_EXPECT(OnUIActivate
);
82 DEFINE_EXPECT(GetWindowContext
);
83 DEFINE_EXPECT(Frame_GetWindow
);
84 DEFINE_EXPECT(Frame_SetActiveObject
);
85 DEFINE_EXPECT(UIWindow_SetActiveObject
);
86 DEFINE_EXPECT(SetMenu
);
87 DEFINE_EXPECT(Invoke_AMBIENT_USERMODE
);
88 DEFINE_EXPECT(Invoke_AMBIENT_DLCONTROL
);
89 DEFINE_EXPECT(Invoke_AMBIENT_USERAGENT
);
90 DEFINE_EXPECT(Invoke_AMBIENT_PALETTE
);
91 DEFINE_EXPECT(Invoke_AMBIENT_SILENT
);
92 DEFINE_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
93 DEFINE_EXPECT(Invoke_STATUSTEXTCHANGE
);
94 DEFINE_EXPECT(Invoke_PROPERTYCHANGE
);
95 DEFINE_EXPECT(Invoke_DOWNLOADBEGIN
);
96 DEFINE_EXPECT(Invoke_BEFORENAVIGATE2
);
97 DEFINE_EXPECT(Invoke_SETSECURELOCKICON
);
98 DEFINE_EXPECT(Invoke_FILEDOWNLOAD
);
99 DEFINE_EXPECT(Invoke_COMMANDSTATECHANGE
);
100 DEFINE_EXPECT(Invoke_DOWNLOADCOMPLETE
);
101 DEFINE_EXPECT(Invoke_ONMENUBAR
);
102 DEFINE_EXPECT(Invoke_ONADDRESSBAR
);
103 DEFINE_EXPECT(Invoke_ONSTATUSBAR
);
104 DEFINE_EXPECT(Invoke_ONTOOLBAR
);
105 DEFINE_EXPECT(Invoke_ONFULLSCREEN
);
106 DEFINE_EXPECT(Invoke_ONTHEATERMODE
);
107 DEFINE_EXPECT(Invoke_WINDOWSETRESIZABLE
);
108 DEFINE_EXPECT(Invoke_TITLECHANGE
);
109 DEFINE_EXPECT(Invoke_NAVIGATECOMPLETE2
);
110 DEFINE_EXPECT(Invoke_PROGRESSCHANGE
);
111 DEFINE_EXPECT(Invoke_DOCUMENTCOMPLETE
);
112 DEFINE_EXPECT(Invoke_282
);
113 DEFINE_EXPECT(EnableModeless_TRUE
);
114 DEFINE_EXPECT(EnableModeless_FALSE
);
115 DEFINE_EXPECT(GetHostInfo
);
116 DEFINE_EXPECT(GetOptionKeyPath
);
117 DEFINE_EXPECT(GetOverridesKeyPath
);
118 DEFINE_EXPECT(SetStatusText
);
119 DEFINE_EXPECT(UpdateUI
);
120 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_0
);
121 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_1
);
122 DEFINE_EXPECT(Exec_SETPROGRESSMAX
);
123 DEFINE_EXPECT(Exec_SETPROGRESSPOS
);
124 DEFINE_EXPECT(Exec_UPDATECOMMANDS
);
125 DEFINE_EXPECT(Exec_SETTITLE
);
126 DEFINE_EXPECT(QueryStatus_SETPROGRESSTEXT
);
127 DEFINE_EXPECT(Exec_STOP
);
128 DEFINE_EXPECT(Exec_IDM_STOP
);
129 DEFINE_EXPECT(QueryStatus_STOP
);
130 DEFINE_EXPECT(QueryStatus_IDM_STOP
);
131 DEFINE_EXPECT(DocHost_EnableModeless_TRUE
);
132 DEFINE_EXPECT(DocHost_EnableModeless_FALSE
);
133 DEFINE_EXPECT(DocHost_TranslateAccelerator
);
134 DEFINE_EXPECT(GetDropTarget
);
135 DEFINE_EXPECT(TranslateUrl
);
136 DEFINE_EXPECT(ShowUI
);
137 DEFINE_EXPECT(HideUI
);
138 DEFINE_EXPECT(OnUIDeactivate
);
139 DEFINE_EXPECT(OnInPlaceDeactivate
);
140 DEFINE_EXPECT(RequestUIActivate
);
141 DEFINE_EXPECT(ControlSite_TranslateAccelerator
);
142 DEFINE_EXPECT(OnFocus
);
144 static const WCHAR wszItem
[] = {'i','t','e','m',0};
145 static const WCHAR emptyW
[] = {0};
147 static VARIANT_BOOL exvb
;
149 static IWebBrowser2
*wb
;
151 static HWND container_hwnd
, shell_embedding_hwnd
;
152 static BOOL is_downloading
, is_first_load
, use_container_olecmd
, test_close
;
153 static HRESULT hr_dochost_TranslateAccelerator
= E_NOTIMPL
;
154 static HRESULT hr_site_TranslateAccelerator
= E_NOTIMPL
;
155 static const char *current_url
;
157 #define DWL_EXPECT_BEFORE_NAVIGATE 0x01
158 #define DWL_FROM_PUT_HREF 0x02
160 static DWORD dwl_flags
;
163 /* Returns true if the user interface is in English. Note that this does not
164 * presume of the formatting of dates, numbers, etc.
166 static BOOL
is_lang_english(void)
168 static HMODULE hkernel32
= NULL
;
169 static LANGID (WINAPI
*pGetThreadUILanguage
)(void) = NULL
;
170 static LANGID (WINAPI
*pGetUserDefaultUILanguage
)(void) = NULL
;
174 hkernel32
= GetModuleHandleA("kernel32.dll");
175 pGetThreadUILanguage
= (void*)GetProcAddress(hkernel32
, "GetThreadUILanguage");
176 pGetUserDefaultUILanguage
= (void*)GetProcAddress(hkernel32
, "GetUserDefaultUILanguage");
178 if (pGetThreadUILanguage
)
179 return PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH
;
180 if (pGetUserDefaultUILanguage
)
181 return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH
;
183 return PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH
;
186 static int strcmp_wa(LPCWSTR strw
, const char *stra
)
189 WideCharToMultiByte(CP_ACP
, 0, strw
, -1, buf
, sizeof(buf
), NULL
, NULL
);
190 return lstrcmpA(stra
, buf
);
193 static BOOL
iface_cmp(IUnknown
*iface1
, IUnknown
*iface2
)
195 IUnknown
*unk1
, *unk2
;
200 IUnknown_QueryInterface(iface1
, &IID_IUnknown
, (void**)&unk1
);
201 IUnknown_Release(unk1
);
202 IUnknown_QueryInterface(iface2
, &IID_IUnknown
, (void**)&unk2
);
203 IUnknown_Release(unk2
);
208 static const char *debugstr_guid(REFIID riid
)
212 sprintf(buf
, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
213 riid
->Data1
, riid
->Data2
, riid
->Data3
, riid
->Data4
[0],
214 riid
->Data4
[1], riid
->Data4
[2], riid
->Data4
[3], riid
->Data4
[4],
215 riid
->Data4
[5], riid
->Data4
[6], riid
->Data4
[7]);
220 static BSTR
a2bstr(const char *str
)
225 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
226 ret
= SysAllocStringLen(NULL
, len
);
227 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
232 #define create_WebBrowser(a) _create_WebBrowser(__LINE__,a)
233 static HRESULT
_create_WebBrowser(unsigned line
, IUnknown
**unk
)
237 hres
= CoCreateInstance(&CLSID_WebBrowser
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
238 &IID_IUnknown
, (void**)unk
);
239 ok_(__FILE__
,line
)(hres
== S_OK
, "Creating WebBrowser object failed: %08x\n", hres
);
243 #define test_LocationURL(a,b) _test_LocationURL(__LINE__,a,b)
244 static void _test_LocationURL(unsigned line
, IUnknown
*unk
, const char *exurl
)
247 BSTR url
= (void*)0xdeadbeef;
250 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
251 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
255 hres
= IWebBrowser2_get_LocationURL(wb
, &url
);
256 ok_(__FILE__
,line
) (hres
== (*exurl
? S_OK
: S_FALSE
), "get_LocationURL failed: %08x\n", hres
);
259 ok_(__FILE__
,line
) (!strcmp_wa(url
, exurl
), "unexpected URL: %s\n", wine_dbgstr_w(url
));
263 IWebBrowser2_Release(wb
);
266 #define test_ready_state(ex) _test_ready_state(__LINE__,ex);
267 static void _test_ready_state(unsigned line
, READYSTATE exstate
)
272 hres
= IWebBrowser2_get_ReadyState(wb
, &state
);
273 ok_(__FILE__
,line
)(hres
== S_OK
, "get_ReadyState failed: %08x\n", hres
);
274 ok_(__FILE__
,line
)(state
== exstate
, "ReadyState = %d, expected %d\n", state
, exstate
);
277 #define get_document(u) _get_document(__LINE__,u)
278 static IDispatch
*_get_document(unsigned line
, IUnknown
*unk
)
280 IHTMLDocument2
*html_doc
;
285 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
286 ok_(__FILE__
,line
)(hres
== S_OK
, "QueryInterface(IID_IWebBrowser2) failed: %08x\n", hres
);
289 hres
= IWebBrowser2_get_Document(wb
, &disp
);
290 IWebBrowser2_Release(wb
);
291 ok_(__FILE__
,line
)(hres
== S_OK
, "get_Document failed: %08x\n", hres
);
292 ok_(__FILE__
,line
)(disp
!= NULL
, "doc_disp == NULL\n");
294 hres
= IDispatch_QueryInterface(disp
, &IID_IHTMLDocument2
, (void**)&html_doc
);
295 ok_(__FILE__
,line
)(hres
== S_OK
, "Could not get IHTMLDocument iface: %08x\n", hres
);
296 ok(disp
== (IDispatch
*)html_doc
, "disp != html_doc\n");
297 IHTMLDocument_Release(html_doc
);
302 #define get_dochost(u) _get_dochost(__LINE__,u)
303 static IOleClientSite
*_get_dochost(unsigned line
, IUnknown
*unk
)
305 IOleClientSite
*client_site
;
310 doc
= _get_document(line
, unk
);
311 hres
= IDispatch_QueryInterface(doc
, &IID_IOleObject
, (void**)&oleobj
);
312 IDispatch_Release(doc
);
313 ok_(__FILE__
,line
)(hres
== S_OK
, "Got 0x%08x\n", hres
);
315 hres
= IOleObject_GetClientSite(oleobj
, &client_site
);
316 IOleObject_Release(oleobj
);
317 ok_(__FILE__
,line
)(hres
== S_OK
, "Got 0x%08x\n", hres
);
322 static HRESULT
QueryInterface(REFIID
,void**);
324 static HRESULT WINAPI
OleCommandTarget_QueryInterface(IOleCommandTarget
*iface
,
325 REFIID riid
, void **ppv
)
327 ok(0, "unexpected call\n");
328 return E_NOINTERFACE
;
331 static ULONG WINAPI
OleCommandTarget_AddRef(IOleCommandTarget
*iface
)
336 static ULONG WINAPI
OleCommandTarget_Release(IOleCommandTarget
*iface
)
341 static HRESULT WINAPI
OleCommandTarget_QueryStatus(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
342 ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
*pCmdText
)
344 ok(!pguidCmdGroup
, "pguidCmdGroup != MULL\n");
345 ok(cCmds
== 1, "cCmds=%d, expected 1\n", cCmds
);
346 ok(!pCmdText
, "pCmdText != NULL\n");
348 switch(prgCmds
[0].cmdID
) {
350 CHECK_EXPECT2(QueryStatus_STOP
);
351 prgCmds
[0].cmdf
= OLECMDF_SUPPORTED
;
353 case OLECMDID_SETPROGRESSTEXT
:
354 CHECK_EXPECT(QueryStatus_SETPROGRESSTEXT
);
355 prgCmds
[0].cmdf
= OLECMDF_ENABLED
;
359 * IDM_STOP is a command specific to CGID_MSHTML (not an OLECMDID command).
360 * This command appears here for the ExecWB and QueryStatusWB tests in order
361 * to help demonstrate that these routines use a NULL pguidCmdGroup.
363 CHECK_EXPECT(QueryStatus_IDM_STOP
);
367 ok(0, "unexpected command %d\n", prgCmds
[0].cmdID
);
373 static HRESULT WINAPI
OleCommandTarget_Exec(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
374 DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
378 case OLECMDID_SETPROGRESSMAX
:
379 CHECK_EXPECT2(Exec_SETPROGRESSMAX
);
380 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
381 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
383 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
384 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
386 case OLECMDID_SETPROGRESSPOS
:
387 CHECK_EXPECT2(Exec_SETPROGRESSPOS
);
388 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
389 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
391 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
392 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
394 case OLECMDID_SETDOWNLOADSTATE
:
396 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
|| !nCmdexecopt
,
397 "nCmdexecopts=%08x\n", nCmdexecopt
);
399 ok(!nCmdexecopt
, "nCmdexecopts=%08x\n", nCmdexecopt
);
400 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
401 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
402 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d\n", V_VT(pvaIn
));
403 switch(V_I4(pvaIn
)) {
405 CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_0
);
408 CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_1
);
411 ok(0, "unexpevted V_I4(pvaIn)=%d\n", V_I4(pvaIn
));
414 case OLECMDID_UPDATECOMMANDS
:
415 CHECK_EXPECT(Exec_UPDATECOMMANDS
);
416 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
417 ok(!pvaIn
, "pvaIn != NULL\n");
418 ok(!pvaOut
, "pvaOut=%p, expected NULL\n", pvaOut
);
420 case OLECMDID_SETTITLE
:
421 CHECK_EXPECT(Exec_SETTITLE
);
422 /* TODO: test args */
425 CHECK_EXPECT(Exec_STOP
);
429 * IDM_STOP is a command specific to CGID_MSHTML (not an OLECMDID command).
430 * This command appears here for the ExecWB and QueryStatusWB tests in order
431 * to help demonstrate that these routines use a NULL pguidCmdGroup.
433 CHECK_EXPECT(Exec_IDM_STOP
);
434 return OLECMDERR_E_NOTSUPPORTED
;
436 ok(0, "unexpected nsCmdID %d\n", nCmdID
);
438 }else if(IsEqualGUID(&CGID_Explorer
, pguidCmdGroup
)) {
447 case 101: /* TODO (IE8) */
450 ok(0, "unexpected nCmdID %d\n", nCmdID
);
452 }else if(IsEqualGUID(&CGID_ShellDocView
, pguidCmdGroup
)) {
455 case 140: /* TODO (Win7) */
458 ok(0, "unexpected nCmdID %d\n", nCmdID
);
460 }else if(IsEqualGUID(&CGID_DocHostCmdPriv
, pguidCmdGroup
)) {
465 ok(0, "unexpected nCmdID %d of CGID_DocHostCmdPriv\n", nCmdID
);
467 }else if(IsEqualGUID(&CGID_DocHostCommandHandler
, pguidCmdGroup
)) {
469 case 6041: /* TODO */
472 ok(0, "unexpected nCmdID %d of CGID_DocHostCommandHandler\n", nCmdID
);
475 ok(0, "unexpected pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup
));
481 static IOleCommandTargetVtbl OleCommandTargetVtbl
= {
482 OleCommandTarget_QueryInterface
,
483 OleCommandTarget_AddRef
,
484 OleCommandTarget_Release
,
485 OleCommandTarget_QueryStatus
,
486 OleCommandTarget_Exec
489 static IOleCommandTarget OleCommandTarget
= { &OleCommandTargetVtbl
};
491 static HRESULT WINAPI
OleContainer_QueryInterface(IOleContainer
*iface
, REFIID riid
, void **ppv
)
493 if(IsEqualGUID(&IID_ITargetContainer
, riid
))
494 return E_NOINTERFACE
; /* TODO */
496 if(IsEqualGUID(&IID_IOleCommandTarget
, riid
)) {
497 if(use_container_olecmd
)
499 *ppv
= &OleCommandTarget
;
503 return E_NOINTERFACE
;
506 ok(0, "unexpected call\n");
507 return E_NOINTERFACE
;
510 static ULONG WINAPI
OleContainer_AddRef(IOleContainer
*iface
)
515 static ULONG WINAPI
OleContainer_Release(IOleContainer
*iface
)
520 static HRESULT WINAPI
OleContainer_ParseDisplayName(IOleContainer
*iface
, IBindCtx
*pbc
,
521 LPOLESTR pszDiaplayName
, ULONG
*pchEaten
, IMoniker
**ppmkOut
)
523 ok(0, "unexpected call\n");
527 static HRESULT WINAPI
OleContainer_EnumObjects(IOleContainer
*iface
, DWORD grfFlags
,
528 IEnumUnknown
**ppenum
)
530 ok(0, "unexpected call\n");
534 static HRESULT WINAPI
OleContainer_LockContainer(IOleContainer
*iface
, BOOL fLock
)
536 ok(0, "unexpected call\n");
540 static const IOleContainerVtbl OleContainerVtbl
= {
541 OleContainer_QueryInterface
,
543 OleContainer_Release
,
544 OleContainer_ParseDisplayName
,
545 OleContainer_EnumObjects
,
546 OleContainer_LockContainer
549 static IOleContainer OleContainer
= { &OleContainerVtbl
};
551 static HRESULT WINAPI
Dispatch_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
553 return QueryInterface(riid
, ppv
);
556 static ULONG WINAPI
Dispatch_AddRef(IDispatch
*iface
)
561 static ULONG WINAPI
Dispatch_Release(IDispatch
*iface
)
566 static HRESULT WINAPI
Dispatch_GetTypeInfoCount(IDispatch
*iface
, UINT
*pctinfo
)
568 ok(0, "unexpected call\n");
572 static HRESULT WINAPI
Dispatch_GetTypeInfo(IDispatch
*iface
, UINT iTInfo
, LCID lcid
,
575 ok(0, "unexpected call\n");
579 static HRESULT WINAPI
Dispatch_GetIDsOfNames(IDispatch
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
580 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
582 ok(0, "unexpected call\n");
586 static HRESULT WINAPI
Dispatch_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
587 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
588 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
590 ok(IsEqualGUID(&IID_NULL
, riid
), "riid != IID_NULL\n");
591 ok(pDispParams
!= NULL
, "pDispParams == NULL\n");
592 ok(pExcepInfo
== NULL
, "pExcepInfo=%p, expected NULL\n", pExcepInfo
);
593 ok(V_VT(pVarResult
) == VT_EMPTY
, "V_VT(pVarResult)=%d\n", V_VT(pVarResult
));
594 ok(wFlags
== DISPATCH_PROPERTYGET
, "wFlags=%08x, expected DISPATCH_PROPERTYGET\n", wFlags
);
595 ok(pDispParams
->rgvarg
== NULL
, "pDispParams->rgvarg = %p\n", pDispParams
->rgvarg
);
596 ok(pDispParams
->rgdispidNamedArgs
== NULL
,
597 "pDispParams->rgdispidNamedArgs = %p\n", pDispParams
->rgdispidNamedArgs
);
598 ok(pDispParams
->cArgs
== 0, "pDispParams->cArgs = %d\n", pDispParams
->cArgs
);
599 ok(pDispParams
->cNamedArgs
== 0, "pDispParams->cNamedArgs = %d\n", pDispParams
->cNamedArgs
);
601 switch(dispIdMember
) {
602 case DISPID_AMBIENT_USERMODE
:
603 CHECK_EXPECT2(Invoke_AMBIENT_USERMODE
);
605 case DISPID_AMBIENT_DLCONTROL
:
606 CHECK_EXPECT(Invoke_AMBIENT_DLCONTROL
);
607 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
609 case DISPID_AMBIENT_USERAGENT
:
610 CHECK_EXPECT(Invoke_AMBIENT_USERAGENT
);
611 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
613 case DISPID_AMBIENT_PALETTE
:
614 CHECK_EXPECT(Invoke_AMBIENT_PALETTE
);
615 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
617 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
:
618 CHECK_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
619 ok(puArgErr
== NULL
, "puArgErr=%p\n", puArgErr
);
620 V_VT(pVarResult
) = VT_BOOL
;
621 V_BOOL(pVarResult
) = VARIANT_FALSE
;
623 case DISPID_AMBIENT_SILENT
:
624 CHECK_EXPECT(Invoke_AMBIENT_SILENT
);
625 ok(puArgErr
== NULL
, "puArgErr=%p\n", puArgErr
);
626 V_VT(pVarResult
) = VT_BOOL
;
627 V_BOOL(pVarResult
) = VARIANT_FALSE
;
631 ok(0, "unexpected dispIdMember %d\n", dispIdMember
);
635 static IDispatchVtbl DispatchVtbl
= {
636 Dispatch_QueryInterface
,
639 Dispatch_GetTypeInfoCount
,
640 Dispatch_GetTypeInfo
,
641 Dispatch_GetIDsOfNames
,
645 static IDispatch Dispatch
= { &DispatchVtbl
};
647 static HRESULT WINAPI
WebBrowserEvents2_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
651 if(IsEqualGUID(&DIID_DWebBrowserEvents2
, riid
)) {
656 ok(0, "unexpected riid %s\n", debugstr_guid(riid
));
657 return E_NOINTERFACE
;
660 #define test_invoke_bool(p,s) _test_invoke_bool(__LINE__,p,s)
661 static void _test_invoke_bool(unsigned line
, const DISPPARAMS
*params
, BOOL strict
)
663 ok_(__FILE__
,line
) (params
->rgvarg
!= NULL
, "rgvarg == NULL\n");
664 ok_(__FILE__
,line
) (params
->cArgs
== 1, "cArgs=%d, expected 1\n", params
->cArgs
);
665 ok_(__FILE__
,line
) (V_VT(params
->rgvarg
) == VT_BOOL
, "V_VT(arg)=%d\n", V_VT(params
->rgvarg
));
667 ok_(__FILE__
,line
) (V_BOOL(params
->rgvarg
) == exvb
, "V_VT(arg)=%x, expected %x\n",
668 V_BOOL(params
->rgvarg
), exvb
);
670 ok_(__FILE__
,line
) (!V_BOOL(params
->rgvarg
) == !exvb
, "V_VT(arg)=%x, expected %x\n",
671 V_BOOL(params
->rgvarg
), exvb
);
674 static void test_OnBeforeNavigate(const VARIANT
*disp
, const VARIANT
*url
, const VARIANT
*flags
,
675 const VARIANT
*frame
, const VARIANT
*post_data
, const VARIANT
*headers
, const VARIANT
*cancel
)
677 ok(V_VT(disp
) == VT_DISPATCH
, "V_VT(disp)=%d, expected VT_DISPATCH\n", V_VT(disp
));
678 ok(V_DISPATCH(disp
) != NULL
, "V_DISPATCH(disp) == NULL\n");
679 ok(V_DISPATCH(disp
) == (IDispatch
*)wb
, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp
), wb
);
681 ok(V_VT(url
) == (VT_BYREF
|VT_VARIANT
), "V_VT(url)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(url
));
682 ok(V_VARIANTREF(url
) != NULL
, "V_VARIANTREF(url) == NULL)\n");
683 if(V_VARIANTREF(url
)) {
684 ok(V_VT(V_VARIANTREF(url
)) == VT_BSTR
, "V_VT(V_VARIANTREF(url))=%d, expected VT_BSTR\n",
685 V_VT(V_VARIANTREF(url
)));
686 ok(V_BSTR(V_VARIANTREF(url
)) != NULL
, "V_BSTR(V_VARIANTREF(url)) == NULL\n");
687 ok(!strcmp_wa(V_BSTR(V_VARIANTREF(url
)), current_url
), "unexpected url %s, expected %s\n",
688 wine_dbgstr_w(V_BSTR(V_VARIANTREF(url
))), current_url
);
691 ok(V_VT(flags
) == (VT_BYREF
|VT_VARIANT
), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n",
693 ok(V_VT(flags
) == (VT_BYREF
|VT_VARIANT
), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n",
695 ok(V_VARIANTREF(flags
) != NULL
, "V_VARIANTREF(flags) == NULL)\n");
696 if(V_VARIANTREF(flags
)) {
697 ok(V_VT(V_VARIANTREF(flags
)) == VT_I4
, "V_VT(V_VARIANTREF(flags))=%d, expected VT_I4\n",
698 V_VT(V_VARIANTREF(flags
)));
700 ok(V_I4(V_VARIANTREF(flags
)) == 0, "V_I4(V_VARIANTREF(flags)) = %x, expected 0\n",
701 V_I4(V_VARIANTREF(flags
)));
703 ok((V_I4(V_VARIANTREF(flags
)) & ~0x40) == 0, "V_I4(V_VARIANTREF(flags)) = %x, expected 0x40 or 0\n",
704 V_I4(V_VARIANTREF(flags
)));
708 ok(V_VT(frame
) == (VT_BYREF
|VT_VARIANT
), "V_VT(frame)=%x, expected VT_BYREF|VT_VARIANT\n",
710 ok(V_VT(frame
) == (VT_BYREF
|VT_VARIANT
), "V_VT(frame)=%x, expected VT_BYREF|VT_VARIANT\n",
712 ok(V_VARIANTREF(frame
) != NULL
, "V_VARIANTREF(frame) == NULL)\n");
713 if(V_VARIANTREF(frame
)) {
714 ok(V_VT(V_VARIANTREF(frame
)) == VT_BSTR
, "V_VT(V_VARIANTREF(frame))=%d, expected VT_BSTR\n",
715 V_VT(V_VARIANTREF(frame
)));
716 ok(V_BSTR(V_VARIANTREF(frame
)) == NULL
, "V_BSTR(V_VARIANTREF(frame)) = %p, expected NULL\n",
717 V_BSTR(V_VARIANTREF(frame
)));
720 ok(V_VT(post_data
) == (VT_BYREF
|VT_VARIANT
), "V_VT(post_data)=%x, expected VT_BYREF|VT_VARIANT\n",
722 ok(V_VT(post_data
) == (VT_BYREF
|VT_VARIANT
), "V_VT(post_data)=%x, expected VT_BYREF|VT_VARIANT\n",
724 ok(V_VARIANTREF(post_data
) != NULL
, "V_VARIANTREF(post_data) == NULL)\n");
725 if(V_VARIANTREF(post_data
)) {
726 ok(V_VT(V_VARIANTREF(post_data
)) == (VT_VARIANT
|VT_BYREF
),
727 "V_VT(V_VARIANTREF(post_data))=%d, expected VT_VARIANT|VT_BYREF\n",
728 V_VT(V_VARIANTREF(post_data
)));
729 ok(V_VARIANTREF(V_VARIANTREF(post_data
)) != NULL
,
730 "V_VARIANTREF(V_VARIANTREF(post_data)) == NULL\n");
731 if(V_VARIANTREF(V_VARIANTREF(post_data
))) {
732 ok(V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))) == VT_EMPTY
,
733 "V_VT(V_VARIANTREF(V_VARIANTREF(post_data))) = %d, expected VT_EMPTY\n",
734 V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))));
736 if(V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))) == (VT_UI1
|VT_ARRAY
)) {
737 const SAFEARRAY
*sa
= V_ARRAY(V_VARIANTREF(V_VARIANTREF(post_data
)));
739 ok(sa
->cDims
== 1, "sa->cDims = %d, expected 1\n", sa
->cDims
);
740 ok(sa
->fFeatures
== 0, "sa->fFeatures = %d, expected 0\n", sa
->fFeatures
);
745 ok(V_VT(headers
) == (VT_BYREF
|VT_VARIANT
), "V_VT(headers)=%x, expected VT_BYREF|VT_VARIANT\n",
747 ok(V_VARIANTREF(headers
) != NULL
, "V_VARIANTREF(headers) == NULL)\n");
748 if(V_VARIANTREF(headers
)) {
749 ok(V_VT(V_VARIANTREF(headers
)) == VT_BSTR
, "V_VT(V_VARIANTREF(headers))=%d, expected VT_BSTR\n",
750 V_VT(V_VARIANTREF(headers
)));
751 ok(V_BSTR(V_VARIANTREF(headers
)) == NULL
, "V_BSTR(V_VARIANTREF(headers)) = %p, expected NULL\n",
752 V_BSTR(V_VARIANTREF(headers
)));
755 ok(V_VT(cancel
) == (VT_BYREF
|VT_BOOL
), "V_VT(cancel)=%x, expected VT_BYREF|VT_BOOL\n",
757 ok(V_BOOLREF(cancel
) != NULL
, "V_BOOLREF(pDispParams->rgvarg[0] == NULL)\n");
758 if(V_BOOLREF(cancel
))
759 ok(*V_BOOLREF(cancel
) == VARIANT_FALSE
, "*V_BOOLREF(cancel) = %x, expected VARIANT_FALSE\n",
763 static HRESULT WINAPI
WebBrowserEvents2_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
764 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
765 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
767 ok(IsEqualGUID(&IID_NULL
, riid
), "riid != IID_NULL\n");
768 ok(pDispParams
!= NULL
, "pDispParams == NULL\n");
769 ok(pExcepInfo
== NULL
, "pExcepInfo=%p, expected NULL\n", pExcepInfo
);
770 ok(pVarResult
== NULL
, "pVarResult=%p\n", pVarResult
);
771 ok(wFlags
== DISPATCH_METHOD
, "wFlags=%08x, expected DISPATCH_METHOD\n", wFlags
);
772 ok(pDispParams
->rgdispidNamedArgs
== NULL
,
773 "pDispParams->rgdispidNamedArgs = %p\n", pDispParams
->rgdispidNamedArgs
);
774 ok(pDispParams
->cNamedArgs
== 0, "pDispParams->cNamedArgs = %d\n", pDispParams
->cNamedArgs
);
776 switch(dispIdMember
) {
777 case DISPID_STATUSTEXTCHANGE
:
778 CHECK_EXPECT2(Invoke_STATUSTEXTCHANGE
);
780 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
781 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
782 ok(V_VT(pDispParams
->rgvarg
) == VT_BSTR
, "V_VT(pDispParams->rgvarg)=%d, expected VT_BSTR\n",
783 V_VT(pDispParams
->rgvarg
));
784 /* TODO: Check text */
787 case DISPID_PROPERTYCHANGE
:
788 CHECK_EXPECT2(Invoke_PROPERTYCHANGE
);
790 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
791 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
792 /* TODO: Check args */
795 case DISPID_DOWNLOADBEGIN
:
796 CHECK_EXPECT(Invoke_DOWNLOADBEGIN
);
798 ok(pDispParams
->rgvarg
== NULL
, "rgvarg=%p, expected NULL\n", pDispParams
->rgvarg
);
799 ok(pDispParams
->cArgs
== 0, "cArgs=%d, expected 0\n", pDispParams
->cArgs
);
800 test_ready_state(READYSTATE_LOADING
);
803 case DISPID_BEFORENAVIGATE2
:
804 CHECK_EXPECT(Invoke_BEFORENAVIGATE2
);
806 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
807 ok(pDispParams
->cArgs
== 7, "cArgs=%d, expected 7\n", pDispParams
->cArgs
);
808 test_OnBeforeNavigate(pDispParams
->rgvarg
+6, pDispParams
->rgvarg
+5, pDispParams
->rgvarg
+4,
809 pDispParams
->rgvarg
+3, pDispParams
->rgvarg
+2, pDispParams
->rgvarg
+1,
810 pDispParams
->rgvarg
);
811 test_ready_state((dwl_flags
& DWL_FROM_PUT_HREF
) ? READYSTATE_COMPLETE
: READYSTATE_LOADING
);
814 case DISPID_SETSECURELOCKICON
:
815 CHECK_EXPECT2(Invoke_SETSECURELOCKICON
);
817 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
818 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
819 /* TODO: Check args */
822 case DISPID_FILEDOWNLOAD
:
823 CHECK_EXPECT(Invoke_FILEDOWNLOAD
);
825 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
826 ok(pDispParams
->cArgs
== 2, "cArgs=%d, expected 2\n", pDispParams
->cArgs
);
827 /* TODO: Check args */
830 case DISPID_COMMANDSTATECHANGE
:
831 CHECK_EXPECT2(Invoke_COMMANDSTATECHANGE
);
833 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
834 ok(pDispParams
->cArgs
== 2, "cArgs=%d, expected 2\n", pDispParams
->cArgs
);
835 /* TODO: Check args */
838 case DISPID_DOWNLOADCOMPLETE
:
839 CHECK_EXPECT(Invoke_DOWNLOADCOMPLETE
);
841 ok(pDispParams
->rgvarg
== NULL
, "rgvarg=%p, expected NULL\n", pDispParams
->rgvarg
);
842 ok(pDispParams
->cArgs
== 0, "cArgs=%d, expected 0\n", pDispParams
->cArgs
);
843 test_ready_state(READYSTATE_LOADING
);
846 case DISPID_ONMENUBAR
:
847 CHECK_EXPECT(Invoke_ONMENUBAR
);
848 test_invoke_bool(pDispParams
, TRUE
);
851 case DISPID_ONADDRESSBAR
:
852 CHECK_EXPECT(Invoke_ONADDRESSBAR
);
853 test_invoke_bool(pDispParams
, TRUE
);
856 case DISPID_ONSTATUSBAR
:
857 CHECK_EXPECT(Invoke_ONSTATUSBAR
);
858 test_invoke_bool(pDispParams
, TRUE
);
861 case DISPID_ONTOOLBAR
:
862 CHECK_EXPECT(Invoke_ONTOOLBAR
);
863 test_invoke_bool(pDispParams
, FALSE
);
866 case DISPID_ONFULLSCREEN
:
867 CHECK_EXPECT(Invoke_ONFULLSCREEN
);
868 test_invoke_bool(pDispParams
, TRUE
);
871 case DISPID_ONTHEATERMODE
:
872 CHECK_EXPECT(Invoke_ONTHEATERMODE
);
873 test_invoke_bool(pDispParams
, TRUE
);
876 case DISPID_WINDOWSETRESIZABLE
:
877 CHECK_EXPECT(Invoke_WINDOWSETRESIZABLE
);
878 test_invoke_bool(pDispParams
, TRUE
);
881 case DISPID_TITLECHANGE
:
882 CHECK_EXPECT2(Invoke_TITLECHANGE
);
886 case DISPID_NAVIGATECOMPLETE2
:
887 CHECK_EXPECT(Invoke_NAVIGATECOMPLETE2
);
889 test_ready_state((dwl_flags
& DWL_FROM_PUT_HREF
) ? READYSTATE_COMPLETE
: READYSTATE_LOADING
);
892 case DISPID_PROGRESSCHANGE
:
893 CHECK_EXPECT(Invoke_PROGRESSCHANGE
);
897 case DISPID_DOCUMENTCOMPLETE
:
898 CHECK_EXPECT(Invoke_DOCUMENTCOMPLETE
);
900 test_ready_state(READYSTATE_COMPLETE
);
903 case 282: /* FIXME */
904 CHECK_EXPECT2(Invoke_282
);
908 ok(0, "unexpected dispIdMember %d\n", dispIdMember
);
914 static IDispatchVtbl WebBrowserEvents2Vtbl
= {
915 WebBrowserEvents2_QueryInterface
,
918 Dispatch_GetTypeInfoCount
,
919 Dispatch_GetTypeInfo
,
920 Dispatch_GetIDsOfNames
,
921 WebBrowserEvents2_Invoke
924 static IDispatch WebBrowserEvents2
= { &WebBrowserEvents2Vtbl
};
926 static HRESULT WINAPI
ClientSite_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppv
)
928 return QueryInterface(riid
, ppv
);
931 static ULONG WINAPI
ClientSite_AddRef(IOleClientSite
*iface
)
936 static ULONG WINAPI
ClientSite_Release(IOleClientSite
*iface
)
941 static HRESULT WINAPI
ClientSite_SaveObject(IOleClientSite
*iface
)
943 ok(0, "unexpected call\n");
947 static HRESULT WINAPI
ClientSite_GetMoniker(IOleClientSite
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
,
950 ok(0, "unexpected call\n");
954 static HRESULT WINAPI
ClientSite_GetContainer(IOleClientSite
*iface
, IOleContainer
**ppContainer
)
956 CHECK_EXPECT(GetContainer
);
958 ok(ppContainer
!= NULL
, "ppContainer == NULL\n");
960 *ppContainer
= &OleContainer
;
965 static HRESULT WINAPI
ClientSite_ShowObject(IOleClientSite
*iface
)
967 CHECK_EXPECT(ShowObject
);
971 static HRESULT WINAPI
ClientSite_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
973 ok(0, "unexpected call\n");
977 static HRESULT WINAPI
ClientSite_RequestNewObjectLayout(IOleClientSite
*iface
)
979 ok(0, "unexpected call\n");
983 static const IOleClientSiteVtbl ClientSiteVtbl
= {
984 ClientSite_QueryInterface
,
987 ClientSite_SaveObject
,
988 ClientSite_GetMoniker
,
989 ClientSite_GetContainer
,
990 ClientSite_ShowObject
,
991 ClientSite_OnShowWindow
,
992 ClientSite_RequestNewObjectLayout
995 static IOleClientSite ClientSite
= { &ClientSiteVtbl
};
997 static HRESULT WINAPI
IOleControlSite_fnQueryInterface(IOleControlSite
*iface
, REFIID riid
, void **ppv
)
1000 return E_NOINTERFACE
;
1003 static ULONG WINAPI
IOleControlSite_fnAddRef(IOleControlSite
*iface
)
1008 static ULONG WINAPI
IOleControlSite_fnRelease(IOleControlSite
*iface
)
1013 static HRESULT WINAPI
IOleControlSite_fnOnControlInfoChanged(IOleControlSite
* This
)
1015 ok(0, "unexpected call\n");
1019 static HRESULT WINAPI
IOleControlSite_fnLockInPlaceActive(IOleControlSite
* This
,
1022 ok(0, "unexpected call\n");
1026 static HRESULT WINAPI
IOleControlSite_fnGetExtendedControl(IOleControlSite
* This
,
1029 ok(0, "unexpected call\n");
1033 static HRESULT WINAPI
IOleControlSite_fnTransformCoords(IOleControlSite
* This
,
1034 POINTL
*pPtlHimetric
,
1035 POINTF
*pPtfContainer
,
1038 ok(0, "unexpected call\n");
1042 static HRESULT WINAPI
IOleControlSite_fnTranslateAccelerator(IOleControlSite
* This
, MSG
*pMsg
,
1045 CHECK_EXPECT(ControlSite_TranslateAccelerator
);
1046 return hr_site_TranslateAccelerator
;
1049 static HRESULT WINAPI
IOleControlSite_fnOnFocus(IOleControlSite
* This
, BOOL fGotFocus
)
1051 CHECK_EXPECT2(OnFocus
);
1055 static HRESULT WINAPI
IOleControlSite_fnShowPropertyFrame(IOleControlSite
* This
)
1057 ok(0, "unexpected call\n");
1061 static IOleControlSiteVtbl ControlSiteVtbl
= {
1062 IOleControlSite_fnQueryInterface
,
1063 IOleControlSite_fnAddRef
,
1064 IOleControlSite_fnRelease
,
1065 IOleControlSite_fnOnControlInfoChanged
,
1066 IOleControlSite_fnLockInPlaceActive
,
1067 IOleControlSite_fnGetExtendedControl
,
1068 IOleControlSite_fnTransformCoords
,
1069 IOleControlSite_fnTranslateAccelerator
,
1070 IOleControlSite_fnOnFocus
,
1071 IOleControlSite_fnShowPropertyFrame
1074 static IOleControlSite ControlSite
= { &ControlSiteVtbl
};
1076 static HRESULT WINAPI
InPlaceUIWindow_QueryInterface(IOleInPlaceFrame
*iface
,
1077 REFIID riid
, void **ppv
)
1079 ok(0, "unexpected call\n");
1080 return E_NOINTERFACE
;
1083 static ULONG WINAPI
InPlaceUIWindow_AddRef(IOleInPlaceFrame
*iface
)
1088 static ULONG WINAPI
InPlaceUIWindow_Release(IOleInPlaceFrame
*iface
)
1093 static HRESULT WINAPI
InPlaceUIWindow_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
1095 ok(0, "unexpected call\n");
1099 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
1101 CHECK_EXPECT(Frame_GetWindow
);
1102 ok(phwnd
!= NULL
, "phwnd == NULL\n");
1104 *phwnd
= container_hwnd
;
1108 static HRESULT WINAPI
InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
1110 ok(0, "unexpected call\n");
1114 static HRESULT WINAPI
InPlaceUIWindow_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
1116 ok(0, "unexpected call\n");
1120 static HRESULT WINAPI
InPlaceUIWindow_RequestBorderSpace(IOleInPlaceFrame
*iface
,
1121 LPCBORDERWIDTHS pborderwidths
)
1123 ok(0, "unexpected call\n");
1127 static HRESULT WINAPI
InPlaceUIWindow_SetBorderSpace(IOleInPlaceFrame
*iface
,
1128 LPCBORDERWIDTHS pborderwidths
)
1130 ok(0, "unexpected call\n");
1134 static HRESULT WINAPI
InPlaceUIWindow_SetActiveObject(IOleInPlaceFrame
*iface
,
1135 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
1137 CHECK_EXPECT(UIWindow_SetActiveObject
);
1139 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
1140 ok(!lstrcmpW(pszObjName
, wszItem
), "unexpected pszObjName\n");
1142 ok(!pActiveObject
, "pActiveObject != NULL\n");
1143 ok(!pszObjName
, "pszObjName != NULL\n");
1148 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
1149 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
1151 CHECK_EXPECT(Frame_SetActiveObject
);
1153 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
1154 ok(!lstrcmpW(pszObjName
, wszItem
), "unexpected pszObjName\n");
1156 ok(!pActiveObject
, "pActiveObject != NULL\n");
1157 ok(!pszObjName
, "pszObjName != NULL\n");
1162 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
1163 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
1165 ok(0, "unexpected call\n");
1169 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
1170 HOLEMENU holemenu
, HWND hwndActiveObject
)
1172 CHECK_EXPECT(SetMenu
);
1173 ok(hmenuShared
== NULL
, "hmenuShared=%p\n", hmenuShared
);
1174 ok(holemenu
== NULL
, "holemenu=%p\n", holemenu
);
1175 ok(hwndActiveObject
== shell_embedding_hwnd
, "hwndActiveObject=%p, expected %p\n",
1176 hwndActiveObject
, shell_embedding_hwnd
);
1180 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
1182 ok(0, "unexpected call\n");
1186 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
1188 CHECK_EXPECT2(SetStatusText
);
1189 /* FIXME: Check pszStatusText */
1193 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
1196 CHECK_EXPECT2(EnableModeless_TRUE
);
1198 CHECK_EXPECT2(EnableModeless_FALSE
);
1202 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
1204 ok(0, "unexpected call\n");
1208 static const IOleInPlaceFrameVtbl InPlaceUIWindowVtbl
= {
1209 InPlaceUIWindow_QueryInterface
,
1210 InPlaceUIWindow_AddRef
,
1211 InPlaceUIWindow_Release
,
1212 InPlaceUIWindow_GetWindow
,
1213 InPlaceUIWindow_ContextSensitiveHelp
,
1214 InPlaceUIWindow_GetBorder
,
1215 InPlaceUIWindow_RequestBorderSpace
,
1216 InPlaceUIWindow_SetBorderSpace
,
1217 InPlaceUIWindow_SetActiveObject
,
1220 static IOleInPlaceUIWindow InPlaceUIWindow
= { (IOleInPlaceUIWindowVtbl
*)&InPlaceUIWindowVtbl
};
1222 static const IOleInPlaceFrameVtbl InPlaceFrameVtbl
= {
1223 InPlaceUIWindow_QueryInterface
,
1224 InPlaceUIWindow_AddRef
,
1225 InPlaceUIWindow_Release
,
1226 InPlaceFrame_GetWindow
,
1227 InPlaceUIWindow_ContextSensitiveHelp
,
1228 InPlaceUIWindow_GetBorder
,
1229 InPlaceUIWindow_RequestBorderSpace
,
1230 InPlaceUIWindow_SetBorderSpace
,
1231 InPlaceFrame_SetActiveObject
,
1232 InPlaceFrame_InsertMenus
,
1233 InPlaceFrame_SetMenu
,
1234 InPlaceFrame_RemoveMenus
,
1235 InPlaceFrame_SetStatusText
,
1236 InPlaceFrame_EnableModeless
,
1237 InPlaceFrame_TranslateAccelerator
1240 static IOleInPlaceFrame InPlaceFrame
= { &InPlaceFrameVtbl
};
1242 static HRESULT WINAPI
InPlaceSite_QueryInterface(IOleInPlaceSiteEx
*iface
, REFIID riid
, void **ppv
)
1244 return QueryInterface(riid
, ppv
);
1247 static ULONG WINAPI
InPlaceSite_AddRef(IOleInPlaceSiteEx
*iface
)
1252 static ULONG WINAPI
InPlaceSite_Release(IOleInPlaceSiteEx
*iface
)
1257 static HRESULT WINAPI
InPlaceSite_GetWindow(IOleInPlaceSiteEx
*iface
, HWND
*phwnd
)
1259 CHECK_EXPECT(Site_GetWindow
);
1260 ok(phwnd
!= NULL
, "phwnd == NULL\n");
1262 *phwnd
= container_hwnd
;
1266 static HRESULT WINAPI
InPlaceSite_ContextSensitiveHelp(IOleInPlaceSiteEx
*iface
, BOOL fEnterMode
)
1268 ok(0, "unexpected call\n");
1272 static HRESULT WINAPI
InPlaceSite_CanInPlaceActivate(IOleInPlaceSiteEx
*iface
)
1274 CHECK_EXPECT(CanInPlaceActivate
);
1278 static HRESULT WINAPI
InPlaceSite_OnInPlaceActivate(IOleInPlaceSiteEx
*iface
)
1280 CHECK_EXPECT(OnInPlaceActivate
);
1284 static HRESULT WINAPI
InPlaceSite_OnUIActivate(IOleInPlaceSiteEx
*iface
)
1286 CHECK_EXPECT(OnUIActivate
);
1290 static HRESULT WINAPI
InPlaceSite_GetWindowContext(IOleInPlaceSiteEx
*iface
,
1291 IOleInPlaceFrame
**ppFrame
, IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
1292 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
1294 static const RECT pos_rect
= {2,1,1002,901};
1295 static const RECT clip_rect
= {10,10,990,890};
1297 CHECK_EXPECT(GetWindowContext
);
1299 ok(ppFrame
!= NULL
, "ppFrame = NULL\n");
1301 *ppFrame
= &InPlaceFrame
;
1303 ok(ppDoc
!= NULL
, "ppDoc = NULL\n");
1305 *ppDoc
= &InPlaceUIWindow
;
1307 ok(lprcPosRect
!= NULL
, "lprcPosRect = NULL\n");
1309 memcpy(lprcPosRect
, &pos_rect
, sizeof(RECT
));
1311 ok(lprcClipRect
!= NULL
, "lprcClipRect = NULL\n");
1313 memcpy(lprcClipRect
, &clip_rect
, sizeof(RECT
));
1315 ok(lpFrameInfo
!= NULL
, "lpFrameInfo = NULL\n");
1317 ok(lpFrameInfo
->cb
== sizeof(*lpFrameInfo
), "lpFrameInfo->cb = %u, expected %u\n", lpFrameInfo
->cb
, (unsigned)sizeof(*lpFrameInfo
));
1318 lpFrameInfo
->fMDIApp
= FALSE
;
1319 lpFrameInfo
->hwndFrame
= container_hwnd
;
1320 lpFrameInfo
->haccel
= NULL
;
1321 lpFrameInfo
->cAccelEntries
= 0;
1327 static HRESULT WINAPI
InPlaceSite_Scroll(IOleInPlaceSiteEx
*iface
, SIZE scrollExtant
)
1329 ok(0, "unexpected call\n");
1333 static HRESULT WINAPI
InPlaceSite_OnUIDeactivate(IOleInPlaceSiteEx
*iface
, BOOL fUndoable
)
1335 CHECK_EXPECT(OnUIDeactivate
);
1336 ok(!fUndoable
, "fUndoable should be FALSE\n");
1340 static HRESULT WINAPI
InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSiteEx
*iface
)
1342 CHECK_EXPECT(OnInPlaceDeactivate
);
1346 static HRESULT WINAPI
InPlaceSite_DiscardUndoState(IOleInPlaceSiteEx
*iface
)
1348 ok(0, "unexpected call\n");
1352 static HRESULT WINAPI
InPlaceSite_DeactivateAndUndo(IOleInPlaceSiteEx
*iface
)
1354 ok(0, "unexpected call\n");
1358 static HRESULT WINAPI
InPlaceSite_OnPosRectChange(IOleInPlaceSiteEx
*iface
, LPCRECT lprcPosRect
)
1360 ok(0, "unexpected call\n");
1364 static HRESULT WINAPI
InPlaceSite_OnInPlaceActivateEx(IOleInPlaceSiteEx
*iface
,
1365 BOOL
*pNoRedraw
, DWORD dwFlags
)
1367 ok(0, "unexpected call\n");
1371 static HRESULT WINAPI
InPlaceSite_OnInPlaceDeactivateEx(IOleInPlaceSiteEx
*iface
,
1374 ok(0, "unexpected call\n");
1378 static HRESULT WINAPI
InPlaceSite_RequestUIActivate(IOleInPlaceSiteEx
*iface
)
1380 CHECK_EXPECT2(RequestUIActivate
);
1384 static const IOleInPlaceSiteExVtbl InPlaceSiteExVtbl
= {
1385 InPlaceSite_QueryInterface
,
1387 InPlaceSite_Release
,
1388 InPlaceSite_GetWindow
,
1389 InPlaceSite_ContextSensitiveHelp
,
1390 InPlaceSite_CanInPlaceActivate
,
1391 InPlaceSite_OnInPlaceActivate
,
1392 InPlaceSite_OnUIActivate
,
1393 InPlaceSite_GetWindowContext
,
1395 InPlaceSite_OnUIDeactivate
,
1396 InPlaceSite_OnInPlaceDeactivate
,
1397 InPlaceSite_DiscardUndoState
,
1398 InPlaceSite_DeactivateAndUndo
,
1399 InPlaceSite_OnPosRectChange
,
1400 InPlaceSite_OnInPlaceActivateEx
,
1401 InPlaceSite_OnInPlaceDeactivateEx
,
1402 InPlaceSite_RequestUIActivate
1405 static IOleInPlaceSiteEx InPlaceSite
= { &InPlaceSiteExVtbl
};
1407 static HRESULT WINAPI
DocHostUIHandler_QueryInterface(IDocHostUIHandler2
*iface
, REFIID riid
, void **ppv
)
1409 return QueryInterface(riid
, ppv
);
1412 static ULONG WINAPI
DocHostUIHandler_AddRef(IDocHostUIHandler2
*iface
)
1417 static ULONG WINAPI
DocHostUIHandler_Release(IDocHostUIHandler2
*iface
)
1422 static HRESULT WINAPI
DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2
*iface
, DWORD dwID
, POINT
*ppt
,
1423 IUnknown
*pcmdtReserved
, IDispatch
*pdicpReserved
)
1425 ok(0, "unexpected call %d %p %p %p\n", dwID
, ppt
, pcmdtReserved
, pdicpReserved
);
1429 static HRESULT WINAPI
DocHostUIHandler_GetHostInfo(IDocHostUIHandler2
*iface
, DOCHOSTUIINFO
*pInfo
)
1431 CHECK_EXPECT2(GetHostInfo
);
1432 ok(pInfo
!= NULL
, "pInfo=NULL\n");
1434 ok(pInfo
->cbSize
== sizeof(DOCHOSTUIINFO
) || broken(!pInfo
->cbSize
), "pInfo->cbSize=%u\n", pInfo
->cbSize
);
1435 ok(!pInfo
->dwFlags
, "pInfo->dwFlags=%08x, expected 0\n", pInfo
->dwFlags
);
1436 ok(!pInfo
->dwDoubleClick
, "pInfo->dwDoubleClick=%08x, expected 0\n", pInfo
->dwDoubleClick
);
1437 ok(!pInfo
->pchHostCss
, "pInfo->pchHostCss=%p, expected NULL\n", pInfo
->pchHostCss
);
1438 ok(!pInfo
->pchHostNS
, "pInfo->pchhostNS=%p, expected NULL\n", pInfo
->pchHostNS
);
1443 static HRESULT WINAPI
DocHostUIHandler_ShowUI(IDocHostUIHandler2
*iface
, DWORD dwID
,
1444 IOleInPlaceActiveObject
*pActiveObject
, IOleCommandTarget
*pCommandTarget
,
1445 IOleInPlaceFrame
*pFrame
, IOleInPlaceUIWindow
*pDoc
)
1447 CHECK_EXPECT(ShowUI
);
1451 static HRESULT WINAPI
DocHostUIHandler_HideUI(IDocHostUIHandler2
*iface
)
1453 CHECK_EXPECT(HideUI
);
1457 static HRESULT WINAPI
DocHostUIHandler_UpdateUI(IDocHostUIHandler2
*iface
)
1459 CHECK_EXPECT(UpdateUI
);
1463 static HRESULT WINAPI
DocHostUIHandler_EnableModeless(IDocHostUIHandler2
*iface
, BOOL fEnable
)
1466 CHECK_EXPECT(DocHost_EnableModeless_TRUE
);
1468 CHECK_EXPECT(DocHost_EnableModeless_FALSE
);
1473 static HRESULT WINAPI
DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1475 ok(0, "unexpected call\n");
1479 static HRESULT WINAPI
DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1481 ok(0, "unexpected call\n");
1485 static HRESULT WINAPI
DocHostUIHandler_ResizeBorder(IDocHostUIHandler2
*iface
, LPCRECT prcBorder
,
1486 IOleInPlaceUIWindow
*pUIWindow
, BOOL fRameWindow
)
1488 ok(0, "unexpected call\n");
1492 static HRESULT WINAPI
DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2
*iface
, LPMSG lpMsg
,
1493 const GUID
*pguidCmdGroup
, DWORD nCmdID
)
1495 CHECK_EXPECT(DocHost_TranslateAccelerator
);
1496 ok(pguidCmdGroup
!= NULL
, "Got NULL pguidCmdGroup.\n");
1498 ok(IsEqualGUID(pguidCmdGroup
, &CGID_MSHTML
), "Unexpected pguidCmdGroup\n");
1499 ok(lpMsg
!= NULL
, "Got NULL lpMsg.\n");
1500 return hr_dochost_TranslateAccelerator
;
1503 static HRESULT WINAPI
DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2
*iface
,
1504 LPOLESTR
*pchKey
, DWORD dw
)
1506 CHECK_EXPECT(GetOptionKeyPath
);
1507 ok(pchKey
!= NULL
, "pchKey==NULL\n");
1509 ok(*pchKey
== NULL
, "*pchKey=%p\n", *pchKey
);
1510 ok(!dw
, "dw=%x\n", dw
);
1514 static HRESULT WINAPI
DocHostUIHandler_GetDropTarget(IDocHostUIHandler2
*iface
,
1515 IDropTarget
*pDropTarget
, IDropTarget
**ppDropTarget
)
1517 CHECK_EXPECT(GetDropTarget
);
1521 static HRESULT WINAPI
DocHostUIHandler_GetExternal(IDocHostUIHandler2
*iface
, IDispatch
**ppDispatch
)
1523 ok(0, "unexpected call\n");
1527 static HRESULT WINAPI
DocHostUIHandler_TranslateUrl(IDocHostUIHandler2
*iface
, DWORD dwTranslate
,
1528 OLECHAR
*pchURLIn
, OLECHAR
**ppchURLOut
)
1530 if(is_downloading
&& !(dwl_flags
& DWL_EXPECT_BEFORE_NAVIGATE
))
1531 todo_wine
CHECK_EXPECT(TranslateUrl
);
1533 CHECK_EXPECT(TranslateUrl
);
1537 static HRESULT WINAPI
DocHostUIHandler_FilterDataObject(IDocHostUIHandler2
*iface
, IDataObject
*pDO
,
1538 IDataObject
**ppPORet
)
1540 ok(0, "unexpected call\n");
1544 static HRESULT WINAPI
DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2
*iface
,
1545 LPOLESTR
*pchKey
, DWORD dw
)
1547 CHECK_EXPECT(GetOverridesKeyPath
);
1548 ok(pchKey
!= NULL
, "pchKey==NULL\n");
1550 ok(*pchKey
== NULL
, "*pchKey=%p\n", *pchKey
);
1551 ok(!dw
, "dw=%x\n", dw
);
1555 static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl
= {
1556 DocHostUIHandler_QueryInterface
,
1557 DocHostUIHandler_AddRef
,
1558 DocHostUIHandler_Release
,
1559 DocHostUIHandler_ShowContextMenu
,
1560 DocHostUIHandler_GetHostInfo
,
1561 DocHostUIHandler_ShowUI
,
1562 DocHostUIHandler_HideUI
,
1563 DocHostUIHandler_UpdateUI
,
1564 DocHostUIHandler_EnableModeless
,
1565 DocHostUIHandler_OnDocWindowActivate
,
1566 DocHostUIHandler_OnFrameWindowActivate
,
1567 DocHostUIHandler_ResizeBorder
,
1568 DocHostUIHandler_TranslateAccelerator
,
1569 DocHostUIHandler_GetOptionKeyPath
,
1570 DocHostUIHandler_GetDropTarget
,
1571 DocHostUIHandler_GetExternal
,
1572 DocHostUIHandler_TranslateUrl
,
1573 DocHostUIHandler_FilterDataObject
,
1574 DocHostUIHandler_GetOverrideKeyPath
1577 static IDocHostUIHandler2 DocHostUIHandler
= { &DocHostUIHandlerVtbl
};
1580 static HRESULT WINAPI
ServiceProvider_QueryInterface(IServiceProvider
*iface
, REFIID riid
, void **ppv
)
1582 return QueryInterface(riid
, ppv
);
1585 static ULONG WINAPI
ServiceProvider_AddRef(IServiceProvider
*iface
)
1590 static ULONG WINAPI
ServiceProvider_Release(IServiceProvider
*iface
)
1595 static HRESULT WINAPI
ServiceProvider_QueryService(IServiceProvider
*iface
,
1596 REFGUID guidService
, REFIID riid
, void **ppv
)
1600 if(!winetest_interactive
)
1601 return E_NOINTERFACE
;
1603 if (IsEqualGUID(&SID_STopLevelBrowser
, guidService
))
1604 trace("Service SID_STopLevelBrowser\n");
1605 else if (IsEqualGUID(&SID_SEditCommandTarget
, guidService
))
1606 trace("Service SID_SEditCommandTarget\n");
1607 else if (IsEqualGUID(&IID_ITargetFrame2
, guidService
))
1608 trace("Service IID_ITargetFrame2\n");
1609 else if (IsEqualGUID(&SID_SInternetSecurityManager
, guidService
))
1610 trace("Service SID_SInternetSecurityManager\n");
1611 else if (IsEqualGUID(&SID_SOleUndoManager
, guidService
))
1612 trace("Service SID_SOleUndoManager\n");
1613 else if (IsEqualGUID(&SID_IMimeInfo
, guidService
))
1614 trace("Service SID_IMimeInfo\n");
1615 else if (IsEqualGUID(&SID_STopWindow
, guidService
))
1616 trace("Service SID_STopWindow\n");
1618 /* 30D02401-6A81-11D0-8274-00C04FD5AE38 Explorer Bar: Search */
1619 /* D1E7AFEC-6A2E-11D0-8C78-00C04FD918B4 no info */
1620 /* A9227C3C-7F8E-11D0-8CB0-00A0C92DBFE8 no info */
1621 /* 371EA634-DC5C-11D1-BA57-00C04FC2040E one reference to IVersionHost */
1622 /* 3050F429-98B5-11CF-BB82-00AA00BDCE0B IID_IElementBehaviorFactory */
1623 /* 6D12FE80-7911-11CF-9534-0000C05BAE0B SID_DefView */
1624 /* AD7F6C62-F6BD-11D2-959B-006097C553C8 no info */
1625 /* 53A2D5B1-D2FC-11D0-84E0-006097C9987D no info */
1626 /* 3050F312-98B5-11CF-BB82-00AA00BDCE0B HTMLFrameBaseClass */
1627 /* 639447BD-B2D3-44B9-9FB0-510F23CB45E4 no info */
1628 /* 20C46561-8491-11CF-960C-0080C7F4EE85 no info */
1631 trace("Service %s not supported\n", debugstr_guid(guidService
));
1633 return E_NOINTERFACE
;
1637 static const IServiceProviderVtbl ServiceProviderVtbl
= {
1638 ServiceProvider_QueryInterface
,
1639 ServiceProvider_AddRef
,
1640 ServiceProvider_Release
,
1641 ServiceProvider_QueryService
1644 static IServiceProvider ServiceProvider
= { &ServiceProviderVtbl
};
1647 static HRESULT
QueryInterface(REFIID riid
, void **ppv
)
1651 if(IsEqualGUID(&IID_IUnknown
, riid
)
1652 || IsEqualGUID(&IID_IOleClientSite
, riid
))
1654 else if(IsEqualGUID(&IID_IOleWindow
, riid
)
1655 || IsEqualGUID(&IID_IOleInPlaceSite
, riid
)
1656 || IsEqualGUID(&IID_IOleInPlaceSiteEx
, riid
))
1657 *ppv
= &InPlaceSite
;
1658 else if(IsEqualGUID(&IID_IDocHostUIHandler
, riid
)
1659 || IsEqualGUID(&IID_IDocHostUIHandler2
, riid
))
1660 *ppv
= &DocHostUIHandler
;
1661 else if(IsEqualGUID(&IID_IDispatch
, riid
))
1663 else if(IsEqualGUID(&IID_IServiceProvider
, riid
))
1664 *ppv
= &ServiceProvider
;
1665 else if(IsEqualGUID(&IID_IDocHostShowUI
, riid
))
1666 trace("interface IID_IDocHostShowUI\n");
1667 else if(IsEqualGUID(&IID_IOleControlSite
, riid
))
1668 *ppv
= &ControlSite
;
1669 else if(IsEqualGUID(&IID_IOleCommandTarget
, riid
))
1670 trace("interface IID_IOleCommandTarget\n");
1672 /* B6EA2050-048A-11D1-82B9-00C04FB9942E IAxWinHostWindow */
1676 /* are there more interfaces, that a host can support? */
1677 trace("%s: interface not supported\n", debugstr_guid(riid
));
1680 return (*ppv
) ? S_OK
: E_NOINTERFACE
;
1683 static LRESULT WINAPI
wnd_proc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
1685 return DefWindowProcW(hwnd
, msg
, wParam
, lParam
);
1688 static HWND
create_container_window(void)
1690 static const WCHAR wszWebBrowserContainer
[] =
1691 {'W','e','b','B','r','o','w','s','e','r','C','o','n','t','a','i','n','e','r',0};
1692 static WNDCLASSEXW wndclass
= {
1693 sizeof(WNDCLASSEXW
),
1696 0, 0, NULL
, NULL
, NULL
, NULL
, NULL
,
1697 wszWebBrowserContainer
,
1701 RegisterClassExW(&wndclass
);
1702 return CreateWindowW(wszWebBrowserContainer
, wszWebBrowserContainer
,
1703 WS_OVERLAPPEDWINDOW
, CW_USEDEFAULT
, CW_USEDEFAULT
, CW_USEDEFAULT
,
1704 CW_USEDEFAULT
, NULL
, NULL
, NULL
, NULL
);
1707 static void test_DoVerb(IUnknown
*unk
)
1710 RECT rect
= {0,0,1000,1000};
1713 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
1714 ok(hres
== S_OK
, "QueryInterface(IID_OleObject) failed: %08x\n", hres
);
1718 SET_EXPECT(CanInPlaceActivate
);
1719 SET_EXPECT(Site_GetWindow
);
1720 SET_EXPECT(OnInPlaceActivate
);
1721 SET_EXPECT(GetWindowContext
);
1722 SET_EXPECT(ShowObject
);
1723 SET_EXPECT(GetContainer
);
1724 SET_EXPECT(Frame_GetWindow
);
1725 SET_EXPECT(OnUIActivate
);
1726 SET_EXPECT(Frame_SetActiveObject
);
1727 SET_EXPECT(UIWindow_SetActiveObject
);
1728 SET_EXPECT(SetMenu
);
1729 SET_EXPECT(OnFocus
);
1731 hres
= IOleObject_DoVerb(oleobj
, OLEIVERB_SHOW
, NULL
, &ClientSite
,
1732 0, (HWND
)0xdeadbeef, &rect
);
1733 ok(hres
== S_OK
, "DoVerb failed: %08x\n", hres
);
1735 CHECK_CALLED(CanInPlaceActivate
);
1736 CHECK_CALLED(Site_GetWindow
);
1737 CHECK_CALLED(OnInPlaceActivate
);
1738 CHECK_CALLED(GetWindowContext
);
1739 CHECK_CALLED(ShowObject
);
1740 CHECK_CALLED(GetContainer
);
1741 CHECK_CALLED(Frame_GetWindow
);
1742 CHECK_CALLED(OnUIActivate
);
1743 CHECK_CALLED(Frame_SetActiveObject
);
1744 CHECK_CALLED(UIWindow_SetActiveObject
);
1745 CHECK_CALLED(SetMenu
);
1746 todo_wine
CHECK_CALLED(OnFocus
);
1748 hres
= IOleObject_DoVerb(oleobj
, OLEIVERB_SHOW
, NULL
, &ClientSite
,
1749 0, (HWND
)0xdeadbeef, &rect
);
1750 ok(hres
== S_OK
, "DoVerb failed: %08x\n", hres
);
1752 IOleObject_Release(oleobj
);
1755 static void test_GetMiscStatus(IOleObject
*oleobj
)
1760 for(i
=0; i
<10; i
++) {
1762 hres
= IOleObject_GetMiscStatus(oleobj
, i
, &st
);
1763 ok(hres
== S_OK
, "GetMiscStatus failed: %08x\n", hres
);
1764 ok(st
== (OLEMISC_SETCLIENTSITEFIRST
|OLEMISC_ACTIVATEWHENVISIBLE
|OLEMISC_INSIDEOUT
1765 |OLEMISC_CANTLINKINSIDE
|OLEMISC_RECOMPOSEONRESIZE
),
1766 "st=%08x, expected OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|"
1767 "OLEMISC_INSIDEOUT|OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE)\n", st
);
1771 static void test_SetHostNames(IOleObject
*oleobj
)
1775 static const WCHAR test_appW
[] = {'t','e','s','t',' ','a','p','p',0};
1777 hres
= IOleObject_SetHostNames(oleobj
, test_appW
, (void*)0xdeadbeef);
1778 ok(hres
== S_OK
, "SetHostNames failed: %08x\n", hres
);
1781 static void test_ClientSite(IUnknown
*unk
, IOleClientSite
*client
, BOOL stop_download
)
1784 IOleInPlaceObject
*inplace
;
1788 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
1789 ok(hres
== S_OK
, "QueryInterface(IID_OleObject) failed: %08x\n", hres
);
1793 test_GetMiscStatus(oleobj
);
1794 test_SetHostNames(oleobj
);
1796 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceObject
, (void**)&inplace
);
1797 ok(hres
== S_OK
, "QueryInterface(IID_OleInPlaceObject) failed: %08x\n", hres
);
1799 IOleObject_Release(oleobj
);
1803 hres
= IOleInPlaceObject_GetWindow(inplace
, &hwnd
);
1804 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1805 ok((hwnd
== NULL
) ^ (client
== NULL
), "unexpected hwnd %p\n", hwnd
);
1808 SET_EXPECT(GetContainer
);
1809 SET_EXPECT(Site_GetWindow
);
1810 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1811 SET_EXPECT(Invoke_AMBIENT_SILENT
);
1812 }else if(stop_download
) {
1813 SET_EXPECT(Invoke_DOWNLOADCOMPLETE
);
1814 if (use_container_olecmd
) SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
1815 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
1818 hres
= IOleObject_SetClientSite(oleobj
, client
);
1819 ok(hres
== S_OK
, "SetClientSite failed: %08x\n", hres
);
1822 CHECK_CALLED(GetContainer
);
1823 CHECK_CALLED(Site_GetWindow
);
1824 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1825 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
1826 }else if(stop_download
) {
1827 todo_wine
CHECK_CALLED(Invoke_DOWNLOADCOMPLETE
);
1828 if (use_container_olecmd
) todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
1829 todo_wine
CHECK_CALLED(Invoke_COMMANDSTATECHANGE
);
1832 hres
= IOleInPlaceObject_GetWindow(inplace
, &hwnd
);
1833 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1834 ok((hwnd
== NULL
) == (client
== NULL
), "unexpected hwnd %p\n", hwnd
);
1836 shell_embedding_hwnd
= hwnd
;
1838 test_SetHostNames(oleobj
);
1840 IOleInPlaceObject_Release(inplace
);
1841 IOleObject_Release(oleobj
);
1844 static void test_ClassInfo(IUnknown
*unk
)
1846 IProvideClassInfo2
*class_info
;
1850 hres
= IUnknown_QueryInterface(unk
, &IID_IProvideClassInfo2
, (void**)&class_info
);
1851 ok(hres
== S_OK
, "QueryInterface(IID_IProvideClassInfo) failed: %08x\n", hres
);
1855 hres
= IProvideClassInfo2_GetGUID(class_info
, GUIDKIND_DEFAULT_SOURCE_DISP_IID
, &guid
);
1856 ok(hres
== S_OK
, "GetGUID failed: %08x\n", hres
);
1857 ok(IsEqualGUID(&DIID_DWebBrowserEvents2
, &guid
), "wrong guid\n");
1859 hres
= IProvideClassInfo2_GetGUID(class_info
, 0, &guid
);
1860 ok(hres
== E_FAIL
, "GetGUID failed: %08x, expected E_FAIL\n", hres
);
1861 ok(IsEqualGUID(&IID_NULL
, &guid
), "wrong guid\n");
1863 hres
= IProvideClassInfo2_GetGUID(class_info
, 2, &guid
);
1864 ok(hres
== E_FAIL
, "GetGUID failed: %08x, expected E_FAIL\n", hres
);
1865 ok(IsEqualGUID(&IID_NULL
, &guid
), "wrong guid\n");
1867 hres
= IProvideClassInfo2_GetGUID(class_info
, GUIDKIND_DEFAULT_SOURCE_DISP_IID
, NULL
);
1868 ok(hres
== E_POINTER
, "GetGUID failed: %08x, expected E_POINTER\n", hres
);
1870 hres
= IProvideClassInfo2_GetGUID(class_info
, 0, NULL
);
1871 ok(hres
== E_POINTER
, "GetGUID failed: %08x, expected E_POINTER\n", hres
);
1873 IProvideClassInfo2_Release(class_info
);
1876 static void test_ie_funcs(IUnknown
*unk
)
1886 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
1887 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
1894 hres
= IWebBrowser2_get_HWND(wb
, &hwnd
);
1895 ok(hres
== E_FAIL
, "get_HWND failed: %08x, expected E_FAIL\n", hres
);
1896 ok(hwnd
== 0, "unexpected hwnd %x\n", hwnd
);
1900 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1901 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1902 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1904 SET_EXPECT(Invoke_ONMENUBAR
);
1905 hres
= IWebBrowser2_put_MenuBar(wb
, (exvb
= VARIANT_FALSE
));
1906 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1907 CHECK_CALLED(Invoke_ONMENUBAR
);
1909 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1910 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1911 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1913 SET_EXPECT(Invoke_ONMENUBAR
);
1914 hres
= IWebBrowser2_put_MenuBar(wb
, (exvb
= 100));
1915 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1916 CHECK_CALLED(Invoke_ONMENUBAR
);
1918 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1919 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1920 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1924 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1925 ok(hres
== S_OK
, "get_AddressBar failed: %08x\n", hres
);
1926 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1928 SET_EXPECT(Invoke_ONADDRESSBAR
);
1929 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= VARIANT_FALSE
));
1930 ok(hres
== S_OK
, "put_AddressBar failed: %08x\n", hres
);
1931 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1933 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1934 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1935 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1937 SET_EXPECT(Invoke_ONADDRESSBAR
);
1938 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= 100));
1939 ok(hres
== S_OK
, "put_AddressBar failed: %08x\n", hres
);
1940 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1942 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1943 ok(hres
== S_OK
, "get_AddressBar failed: %08x\n", hres
);
1944 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1946 SET_EXPECT(Invoke_ONADDRESSBAR
);
1947 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= VARIANT_TRUE
));
1948 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1949 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1953 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1954 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1955 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1957 SET_EXPECT(Invoke_ONSTATUSBAR
);
1958 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= VARIANT_TRUE
));
1959 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1960 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1962 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1963 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1964 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1966 SET_EXPECT(Invoke_ONSTATUSBAR
);
1967 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= VARIANT_FALSE
));
1968 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1969 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1971 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1972 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1973 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1975 SET_EXPECT(Invoke_ONSTATUSBAR
);
1976 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= 100));
1977 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1978 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1980 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1981 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1982 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1986 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
1987 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
1990 SET_EXPECT(Invoke_ONTOOLBAR
);
1991 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= VARIANT_FALSE
));
1992 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
1993 CHECK_CALLED(Invoke_ONTOOLBAR
);
1995 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
1996 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
1997 ok(i
== VARIANT_FALSE
, "b=%x\n", i
);
1999 SET_EXPECT(Invoke_ONTOOLBAR
);
2000 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= 100));
2001 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
2002 CHECK_CALLED(Invoke_ONTOOLBAR
);
2004 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
2005 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
2008 SET_EXPECT(Invoke_ONTOOLBAR
);
2009 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= VARIANT_TRUE
));
2010 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
2011 CHECK_CALLED(Invoke_ONTOOLBAR
);
2015 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
2016 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
2017 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2019 SET_EXPECT(Invoke_ONFULLSCREEN
);
2020 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= VARIANT_TRUE
));
2021 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
2022 CHECK_CALLED(Invoke_ONFULLSCREEN
);
2024 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
2025 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
2026 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2028 SET_EXPECT(Invoke_ONFULLSCREEN
);
2029 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= 100));
2030 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
2031 CHECK_CALLED(Invoke_ONFULLSCREEN
);
2033 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
2034 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
2035 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2037 SET_EXPECT(Invoke_ONFULLSCREEN
);
2038 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= VARIANT_FALSE
));
2039 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
2040 CHECK_CALLED(Invoke_ONFULLSCREEN
);
2044 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
2045 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
2046 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2048 SET_EXPECT(Invoke_ONTHEATERMODE
);
2049 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= VARIANT_TRUE
));
2050 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
2051 CHECK_CALLED(Invoke_ONTHEATERMODE
);
2053 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
2054 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
2055 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2057 SET_EXPECT(Invoke_ONTHEATERMODE
);
2058 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= 100));
2059 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
2060 CHECK_CALLED(Invoke_ONTHEATERMODE
);
2062 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
2063 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
2064 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2066 SET_EXPECT(Invoke_ONTHEATERMODE
);
2067 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= VARIANT_FALSE
));
2068 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
2069 CHECK_CALLED(Invoke_ONTHEATERMODE
);
2074 hres
= IWebBrowser2_get_Resizable(wb
, &b
);
2075 ok(hres
== E_NOTIMPL
, "get_Resizable failed: %08x\n", hres
);
2076 ok(b
== 0x100, "b=%x\n", b
);
2078 SET_EXPECT(Invoke_WINDOWSETRESIZABLE
);
2079 hres
= IWebBrowser2_put_Resizable(wb
, (exvb
= VARIANT_TRUE
));
2080 ok(hres
== S_OK
, "put_Resizable failed: %08x\n", hres
);
2081 CHECK_CALLED(Invoke_WINDOWSETRESIZABLE
);
2083 SET_EXPECT(Invoke_WINDOWSETRESIZABLE
);
2084 hres
= IWebBrowser2_put_Resizable(wb
, (exvb
= VARIANT_FALSE
));
2085 ok(hres
== S_OK
, "put_Resizable failed: %08x\n", hres
);
2086 CHECK_CALLED(Invoke_WINDOWSETRESIZABLE
);
2088 hres
= IWebBrowser2_get_Resizable(wb
, &b
);
2089 ok(hres
== E_NOTIMPL
, "get_Resizable failed: %08x\n", hres
);
2090 ok(b
== 0x100, "b=%x\n", b
);
2095 hres
= IWebBrowser2_get_Application(wb
, &disp
);
2096 ok(hres
== S_OK
, "get_Application failed: %08x\n", hres
);
2097 ok(disp
== (void*)wb
, "disp=%p, expected %p\n", disp
, wb
);
2099 IDispatch_Release(disp
);
2101 hres
= IWebBrowser2_get_Application(wb
, NULL
);
2102 ok(hres
== E_POINTER
, "get_Application failed: %08x, expected E_POINTER\n", hres
);
2105 hres
= IWebBrowser2_get_Name(wb
, &sName
);
2106 ok(hres
== S_OK
, "getName failed: %08x, expected S_OK\n", hres
);
2107 if (is_lang_english())
2108 ok(!strcmp_wa(sName
, "Microsoft Web Browser Control"), "got '%s', expected 'Microsoft Web Browser Control'\n", wine_dbgstr_w(sName
));
2109 else /* Non-English cannot be blank. */
2110 ok(sName
!=NULL
, "get_Name return a NULL string.\n");
2111 SysFreeString(sName
);
2115 hres
= IWebBrowser2_Quit(wb
);
2116 ok(hres
== E_FAIL
, "Quit failed: %08x, expected E_FAIL\n", hres
);
2118 IWebBrowser2_Release(wb
);
2121 static void test_Silent(IWebBrowser2
*wb
, IOleControl
*control
, BOOL is_clientsite
)
2127 hres
= IWebBrowser2_get_Silent(wb
, &b
);
2128 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
2129 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2131 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_TRUE
);
2132 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
2135 hres
= IWebBrowser2_get_Silent(wb
, &b
);
2136 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
2137 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2139 hres
= IWebBrowser2_put_Silent(wb
, 100);
2140 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
2143 hres
= IWebBrowser2_get_Silent(wb
, &b
);
2144 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
2145 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2147 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_FALSE
);
2148 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
2151 hres
= IWebBrowser2_get_Silent(wb
, &b
);
2152 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
2153 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2156 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_TRUE
);
2157 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
2159 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2162 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_SILENT
);
2163 ok(hres
== S_OK
, "OnAmbientPropertyChange failed %08x\n", hres
);
2166 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2169 hres
= IWebBrowser2_get_Silent(wb
, &b
);
2170 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
2171 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2174 static void test_Offline(IWebBrowser2
*wb
, IOleControl
*control
, BOOL is_clientsite
)
2180 hres
= IWebBrowser2_get_Offline(wb
, &b
);
2181 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
2182 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2184 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_TRUE
);
2185 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
2188 hres
= IWebBrowser2_get_Offline(wb
, &b
);
2189 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
2190 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2192 hres
= IWebBrowser2_put_Offline(wb
, 100);
2193 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
2196 hres
= IWebBrowser2_get_Offline(wb
, &b
);
2197 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
2198 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
2200 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_FALSE
);
2201 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
2204 hres
= IWebBrowser2_get_Offline(wb
, &b
);
2205 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
2206 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2209 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_TRUE
);
2210 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
2212 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2215 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
);
2216 ok(hres
== S_OK
, "OnAmbientPropertyChange failed %08x\n", hres
);
2219 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2222 hres
= IWebBrowser2_get_Offline(wb
, &b
);
2223 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
2224 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
2227 static void test_ambient_unknown(IWebBrowser2
*wb
, IOleControl
*control
, BOOL is_clientsite
)
2231 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2232 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2233 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
2234 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2235 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
2236 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
2238 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_UNKNOWN
);
2239 ok(hres
== S_OK
, "OnAmbientPropertyChange failed %08x\n", hres
);
2241 CHECK_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2242 CHECK_EXPECT(Invoke_AMBIENT_SILENT
);
2243 CHECK_EXPECT(Invoke_AMBIENT_USERMODE
);
2244 CHECK_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2245 CHECK_EXPECT(Invoke_AMBIENT_USERAGENT
);
2246 CHECK_EXPECT(Invoke_AMBIENT_PALETTE
);
2248 CLEAR_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2249 CLEAR_CALLED(Invoke_AMBIENT_SILENT
);
2250 CLEAR_CALLED(Invoke_AMBIENT_USERMODE
);
2251 CLEAR_CALLED(Invoke_AMBIENT_DLCONTROL
);
2252 CLEAR_CALLED(Invoke_AMBIENT_USERAGENT
);
2253 CLEAR_CALLED(Invoke_AMBIENT_PALETTE
);
2256 static void test_wb_funcs(IUnknown
*unk
, BOOL is_clientsite
)
2259 IOleControl
*control
;
2262 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
2263 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
2265 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
2266 ok(hres
== S_OK
, "Could not get IOleControl interface: %08x\n", hres
);
2268 test_Silent(wb
, control
, is_clientsite
);
2269 test_Offline(wb
, control
, is_clientsite
);
2270 test_ambient_unknown(wb
, control
, is_clientsite
);
2272 IWebBrowser_Release(wb
);
2273 IOleControl_Release(control
);
2276 static void test_GetControlInfo(IUnknown
*unk
)
2278 IOleControl
*control
;
2282 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
2283 ok(hres
== S_OK
, "Could not get IOleControl: %08x\n", hres
);
2287 hres
= IOleControl_GetControlInfo(control
, &info
);
2288 ok(hres
== E_NOTIMPL
, "GetControlInfo failed: %08x, expected E_NOTIMPL\n", hres
);
2289 hres
= IOleControl_GetControlInfo(control
, NULL
);
2290 ok(hres
== E_NOTIMPL
, "GetControlInfo failed: %08x, expected E_NOTIMPL\n", hres
);
2292 IOleControl_Release(control
);
2295 static void test_Extent(IUnknown
*unk
)
2298 SIZE size
, expected
;
2304 /* default aspect ratio is 96dpi / 96dpi */
2306 dpi_x
= GetDeviceCaps(hdc
, LOGPIXELSX
);
2307 dpi_y
= GetDeviceCaps(hdc
, LOGPIXELSY
);
2309 if (dpi_x
!= 96 || dpi_y
!= 96)
2310 trace("dpi: %d / %d\n", dpi_y
, dpi_y
);
2312 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
2313 ok(hres
== S_OK
, "Could not get IOleObkect: %08x\n", hres
);
2317 size
.cx
= size
.cy
= 0xdeadbeef;
2318 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
2319 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2320 /* Default size is 50x20 pixels, in himetric units */
2321 expected
.cx
= MulDiv( 50, 2540, dpi_x
);
2322 expected
.cy
= MulDiv( 20, 2540, dpi_y
);
2323 ok(size
.cx
== expected
.cx
&& size
.cy
== expected
.cy
, "size = {%d %d} (expected %d %d)\n",
2324 size
.cx
, size
.cy
, expected
.cx
, expected
.cy
);
2328 hres
= IOleObject_SetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
2329 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
2331 size
.cx
= size
.cy
= 0xdeadbeef;
2332 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
2333 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2334 ok(size
.cx
== 800 && size
.cy
== 700, "size = {%d %d}\n", size
.cx
, size
.cy
);
2336 size
.cx
= size
.cy
= 0xdeadbeef;
2337 hres
= IOleObject_GetExtent(oleobj
, 0, &size
);
2338 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2339 ok(size
.cx
== 800 && size
.cy
== 700, "size = {%d %d}\n", size
.cx
, size
.cy
);
2343 hres
= IOleObject_SetExtent(oleobj
, 0, &size
);
2344 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
2346 size
.cx
= size
.cy
= 0xdeadbeef;
2347 hres
= IOleObject_GetExtent(oleobj
, 0, &size
);
2348 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2349 ok(size
.cx
== 900 && size
.cy
== 800, "size = {%d %d}\n", size
.cx
, size
.cy
);
2351 size
.cx
= size
.cy
= 0xdeadbeef;
2352 hres
= IOleObject_GetExtent(oleobj
, 0xdeadbeef, &size
);
2353 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2354 ok(size
.cx
== 900 && size
.cy
== 800, "size = {%d %d}\n", size
.cx
, size
.cy
);
2358 hres
= IOleObject_SetExtent(oleobj
, 0xdeadbeef, &size
);
2359 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
2361 size
.cx
= size
.cy
= 0xdeadbeef;
2362 hres
= IOleObject_GetExtent(oleobj
, 0xdeadbeef, &size
);
2363 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2364 ok(size
.cx
== 1000 && size
.cy
== 900, "size = {%d %d}\n", size
.cx
, size
.cy
);
2366 size
.cx
= size
.cy
= 0xdeadbeef;
2367 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
2368 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
2369 ok(size
.cx
== 1000 && size
.cy
== 900, "size = {%d %d}\n", size
.cx
, size
.cy
);
2371 IOleObject_Release(oleobj
);
2374 static void test_ConnectionPoint(IUnknown
*unk
, BOOL init
)
2376 IConnectionPointContainer
*container
;
2377 IConnectionPoint
*point
;
2380 static DWORD dw
= 100;
2382 hres
= IUnknown_QueryInterface(unk
, &IID_IConnectionPointContainer
, (void**)&container
);
2383 ok(hres
== S_OK
, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres
);
2387 hres
= IConnectionPointContainer_FindConnectionPoint(container
, &DIID_DWebBrowserEvents2
, &point
);
2388 IConnectionPointContainer_Release(container
);
2389 ok(hres
== S_OK
, "FindConnectionPoint failed: %08x\n", hres
);
2394 hres
= IConnectionPoint_Advise(point
, (IUnknown
*)&WebBrowserEvents2
, &dw
);
2395 ok(hres
== S_OK
, "Advise failed: %08x\n", hres
);
2396 ok(dw
== 1, "dw=%d, expected 1\n", dw
);
2398 hres
= IConnectionPoint_Unadvise(point
, dw
);
2399 ok(hres
== S_OK
, "Unadvise failed: %08x\n", hres
);
2402 IConnectionPoint_Release(point
);
2405 static void test_Navigate2(IUnknown
*unk
)
2407 IWebBrowser2
*webbrowser
;
2411 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&webbrowser
);
2412 ok(hres
== S_OK
, "QueryInterface(IID_IWebBrowser) failed: %08x\n", hres
);
2416 test_LocationURL(unk
, is_first_load
? "" : current_url
);
2417 test_ready_state(is_first_load
? READYSTATE_UNINITIALIZED
: READYSTATE_COMPLETE
);
2419 V_VT(&url
) = VT_BSTR
;
2420 V_BSTR(&url
) = a2bstr("about:blank");
2421 current_url
= "about:blank";
2424 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
2425 SET_EXPECT(Invoke_PROPERTYCHANGE
);
2426 SET_EXPECT(Invoke_BEFORENAVIGATE2
);
2427 SET_EXPECT(Invoke_DOWNLOADBEGIN
);
2428 if (use_container_olecmd
) SET_EXPECT(Exec_SETDOWNLOADSTATE_1
);
2429 SET_EXPECT(EnableModeless_FALSE
);
2430 SET_EXPECT(Invoke_STATUSTEXTCHANGE
);
2431 SET_EXPECT(SetStatusText
);
2432 SET_EXPECT(GetHostInfo
);
2433 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2434 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
2435 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
2436 SET_EXPECT(GetOptionKeyPath
);
2437 SET_EXPECT(GetOverridesKeyPath
);
2438 if (use_container_olecmd
) SET_EXPECT(QueryStatus_SETPROGRESSTEXT
);
2439 if (use_container_olecmd
) SET_EXPECT(Exec_SETPROGRESSMAX
);
2440 if (use_container_olecmd
) SET_EXPECT(Exec_SETPROGRESSPOS
);
2441 SET_EXPECT(Invoke_SETSECURELOCKICON
);
2442 SET_EXPECT(Invoke_FILEDOWNLOAD
);
2443 if (use_container_olecmd
) SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
2444 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
2445 SET_EXPECT(EnableModeless_TRUE
);
2446 if (!use_container_olecmd
) SET_EXPECT(Invoke_DOWNLOADCOMPLETE
);
2449 hres
= IWebBrowser2_Navigate2(webbrowser
, &url
, NULL
, NULL
, NULL
, NULL
);
2450 ok(hres
== S_OK
, "Navigate2 failed: %08x\n", hres
);
2453 CHECK_CALLED(Invoke_AMBIENT_USERMODE
);
2454 todo_wine
CHECK_CALLED(Invoke_PROPERTYCHANGE
);
2455 CHECK_CALLED(Invoke_BEFORENAVIGATE2
);
2456 todo_wine
CHECK_CALLED(Invoke_DOWNLOADBEGIN
);
2457 if (use_container_olecmd
) todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_1
);
2458 CHECK_CALLED(EnableModeless_FALSE
);
2459 CHECK_CALLED(Invoke_STATUSTEXTCHANGE
);
2460 CHECK_CALLED(SetStatusText
);
2461 CHECK_CALLED(GetHostInfo
);
2462 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2463 CHECK_CALLED(Invoke_AMBIENT_USERAGENT
);
2464 CHECK_CALLED(Invoke_AMBIENT_PALETTE
);
2465 CHECK_CALLED(GetOptionKeyPath
);
2466 CHECK_CALLED(GetOverridesKeyPath
);
2467 if (use_container_olecmd
) todo_wine
CHECK_CALLED(QueryStatus_SETPROGRESSTEXT
);
2468 if (use_container_olecmd
) todo_wine
CHECK_CALLED(Exec_SETPROGRESSMAX
);
2469 if (use_container_olecmd
) todo_wine
CHECK_CALLED(Exec_SETPROGRESSPOS
);
2470 todo_wine
CHECK_CALLED(Invoke_SETSECURELOCKICON
);
2471 todo_wine
CHECK_CALLED(Invoke_FILEDOWNLOAD
);
2472 todo_wine
CHECK_CALLED(Invoke_COMMANDSTATECHANGE
);
2473 if (use_container_olecmd
) todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
2474 CHECK_CALLED(EnableModeless_TRUE
);
2478 IWebBrowser2_Release(webbrowser
);
2480 test_ready_state(READYSTATE_LOADING
);
2483 static void test_QueryStatusWB(IWebBrowser2
*webbrowser
, BOOL use_custom_target
, BOOL has_document
)
2485 HRESULT hres
, success_state
;
2486 OLECMDF success_flags
;
2487 enum OLECMDF status
;
2490 * We can tell the difference between the custom container target and the built-in target
2491 * since the custom target returns OLECMDF_SUPPORTED instead of OLECMDF_ENABLED.
2493 if (use_custom_target
)
2494 success_flags
= OLECMDF_SUPPORTED
;
2496 success_flags
= OLECMDF_ENABLED
;
2498 /* When no target is available (no document or custom target) an error is returned */
2500 success_state
= S_OK
;
2502 success_state
= E_UNEXPECTED
;
2505 * Test a safe operation that exists as both a high-numbered MSHTML id and an OLECMDID.
2506 * These tests show that QueryStatusWB uses a NULL pguidCmdGroup, since OLECMDID_STOP
2507 * is enabled and IDM_STOP is not.
2509 status
= 0xdeadbeef;
2510 if (use_custom_target
) SET_EXPECT(QueryStatus_STOP
);
2511 hres
= IWebBrowser2_QueryStatusWB(webbrowser
, OLECMDID_STOP
, &status
);
2512 ok(hres
== success_state
, "QueryStatusWB failed: %08x %08x\n", hres
, success_state
);
2513 if (!use_custom_target
&& has_document
)
2514 todo_wine
ok((has_document
&& status
== success_flags
) || (!has_document
&& status
== 0xdeadbeef),
2515 "OLECMDID_STOP not enabled/supported: %08x %08x\n", status
, success_flags
);
2517 ok((has_document
&& status
== success_flags
) || (!has_document
&& status
== 0xdeadbeef),
2518 "OLECMDID_STOP not enabled/supported: %08x %08x\n", status
, success_flags
);
2519 status
= 0xdeadbeef;
2520 if (use_custom_target
) SET_EXPECT(QueryStatus_IDM_STOP
);
2521 hres
= IWebBrowser2_QueryStatusWB(webbrowser
, IDM_STOP
, &status
);
2522 ok(hres
== success_state
, "QueryStatusWB failed: %08x %08x\n", hres
, success_state
);
2523 ok((has_document
&& status
== 0) || (!has_document
&& status
== 0xdeadbeef),
2524 "IDM_STOP is enabled/supported: %08x %d\n", status
, has_document
);
2527 static void test_ExecWB(IWebBrowser2
*webbrowser
, BOOL use_custom_target
, BOOL has_document
)
2529 HRESULT hres
, olecmdid_state
, idm_state
;
2531 /* When no target is available (no document or custom target) an error is returned */
2534 olecmdid_state
= S_OK
;
2535 idm_state
= OLECMDERR_E_NOTSUPPORTED
;
2539 olecmdid_state
= E_UNEXPECTED
;
2540 idm_state
= E_UNEXPECTED
;
2544 * Test a safe operation that exists as both a high-numbered MSHTML id and an OLECMDID.
2545 * These tests show that QueryStatusWB uses a NULL pguidCmdGroup, since OLECMDID_STOP
2546 * succeeds (S_OK) and IDM_STOP does not (OLECMDERR_E_NOTSUPPORTED).
2548 if (use_custom_target
)
2549 SET_EXPECT(Exec_STOP
);
2550 hres
= IWebBrowser2_ExecWB(webbrowser
, OLECMDID_STOP
, OLECMDEXECOPT_DONTPROMPTUSER
, 0, 0);
2551 if (!use_custom_target
&& has_document
)
2552 todo_wine
ok(hres
== olecmdid_state
, "ExecWB failed: %08x %08x\n", hres
, olecmdid_state
);
2554 ok(hres
== olecmdid_state
, "ExecWB failed: %08x %08x\n", hres
, olecmdid_state
);
2555 if (use_custom_target
)
2556 SET_EXPECT(Exec_IDM_STOP
);
2557 hres
= IWebBrowser2_ExecWB(webbrowser
, IDM_STOP
, OLECMDEXECOPT_DONTPROMPTUSER
, 0, 0);
2558 ok(hres
== idm_state
, "ExecWB failed: %08x %08x\n", hres
, idm_state
);
2561 static void test_download(DWORD flags
)
2565 is_downloading
= TRUE
;
2568 test_ready_state((flags
& DWL_FROM_PUT_HREF
) ? READYSTATE_COMPLETE
: READYSTATE_LOADING
);
2570 if(flags
& DWL_EXPECT_BEFORE_NAVIGATE
) {
2571 SET_EXPECT(Invoke_PROPERTYCHANGE
);
2572 SET_EXPECT(Invoke_BEFORENAVIGATE2
);
2573 SET_EXPECT(TranslateUrl
);
2575 SET_EXPECT(Exec_SETPROGRESSMAX
);
2576 SET_EXPECT(Exec_SETPROGRESSPOS
);
2577 SET_EXPECT(Exec_SETDOWNLOADSTATE_1
);
2578 SET_EXPECT(DocHost_EnableModeless_FALSE
);
2579 SET_EXPECT(DocHost_EnableModeless_TRUE
);
2580 SET_EXPECT(Invoke_SETSECURELOCKICON
);
2581 SET_EXPECT(Invoke_282
);
2582 SET_EXPECT(EnableModeless_FALSE
);
2583 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
2584 SET_EXPECT(Invoke_STATUSTEXTCHANGE
);
2585 SET_EXPECT(SetStatusText
);
2586 SET_EXPECT(EnableModeless_TRUE
);
2588 SET_EXPECT(GetHostInfo
);
2589 SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
2590 SET_EXPECT(Invoke_TITLECHANGE
);
2591 SET_EXPECT(Invoke_NAVIGATECOMPLETE2
);
2593 SET_EXPECT(GetDropTarget
);
2594 SET_EXPECT(Invoke_PROGRESSCHANGE
);
2595 SET_EXPECT(Invoke_DOCUMENTCOMPLETE
);
2597 SET_EXPECT(UpdateUI
);
2598 SET_EXPECT(Exec_UPDATECOMMANDS
);
2599 SET_EXPECT(QueryStatus_STOP
);
2601 while(!called_Invoke_DOCUMENTCOMPLETE
&& GetMessage(&msg
, NULL
, 0, 0)) {
2602 TranslateMessage(&msg
);
2603 DispatchMessage(&msg
);
2606 if(flags
& DWL_EXPECT_BEFORE_NAVIGATE
) {
2607 todo_wine
CHECK_CALLED(Invoke_PROPERTYCHANGE
);
2608 CHECK_CALLED(Invoke_BEFORENAVIGATE2
);
2609 CHECK_CALLED(TranslateUrl
);
2611 todo_wine
CHECK_CALLED(Exec_SETPROGRESSMAX
);
2612 todo_wine
CHECK_CALLED(Exec_SETPROGRESSPOS
);
2613 todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_1
);
2614 CLEAR_CALLED(DocHost_EnableModeless_FALSE
); /* IE 7 */
2615 CLEAR_CALLED(DocHost_EnableModeless_TRUE
); /* IE 7 */
2616 todo_wine
CHECK_CALLED(Invoke_SETSECURELOCKICON
);
2617 CLEAR_CALLED(Invoke_282
); /* IE 7 */
2619 todo_wine
CHECK_CALLED(EnableModeless_FALSE
);
2621 CLEAR_CALLED(EnableModeless_FALSE
); /* IE 8 */
2622 CLEAR_CALLED(Invoke_COMMANDSTATECHANGE
);
2623 todo_wine
CHECK_CALLED(Invoke_STATUSTEXTCHANGE
);
2624 todo_wine
CHECK_CALLED(SetStatusText
);
2626 todo_wine
CHECK_CALLED(EnableModeless_TRUE
);
2628 CLEAR_CALLED(EnableModeless_FALSE
); /* IE 8 */
2630 todo_wine
CHECK_CALLED(GetHostInfo
);
2631 todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
2632 todo_wine
CHECK_CALLED(Invoke_TITLECHANGE
);
2633 CHECK_CALLED(Invoke_NAVIGATECOMPLETE2
);
2635 todo_wine
CHECK_CALLED(GetDropTarget
);
2636 todo_wine
CHECK_CALLED(Invoke_PROGRESSCHANGE
);
2637 CHECK_CALLED(Invoke_DOCUMENTCOMPLETE
);
2639 is_downloading
= FALSE
;
2641 test_ready_state(READYSTATE_COMPLETE
);
2643 while(!called_Exec_UPDATECOMMANDS
&& GetMessage(&msg
, NULL
, 0, 0)) {
2644 TranslateMessage(&msg
);
2645 DispatchMessage(&msg
);
2648 CHECK_CALLED(UpdateUI
);
2649 CHECK_CALLED(Exec_UPDATECOMMANDS
);
2650 CLEAR_CALLED(QueryStatus_STOP
);
2653 static void test_olecmd(IUnknown
*unk
, BOOL loaded
)
2655 IOleCommandTarget
*cmdtrg
;
2659 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2660 ok(hres
== S_OK
, "Could not get IOleCommandTarget iface: %08x\n", hres
);
2664 cmds
[0].cmdID
= OLECMDID_SPELL
;
2665 cmds
[0].cmdf
= 0xdeadbeef;
2666 cmds
[1].cmdID
= OLECMDID_REFRESH
;
2667 cmds
[1].cmdf
= 0xdeadbeef;
2668 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, NULL
, 2, cmds
, NULL
);
2670 ok(hres
== S_OK
, "QueryStatus failed: %08x\n", hres
);
2671 ok(cmds
[0].cmdf
== OLECMDF_SUPPORTED
, "OLECMDID_SPELL cmdf = %x\n", cmds
[0].cmdf
);
2672 ok(cmds
[1].cmdf
== (OLECMDF_ENABLED
|OLECMDF_SUPPORTED
),
2673 "OLECMDID_REFRESH cmdf = %x\n", cmds
[1].cmdf
);
2675 ok(hres
== 0x80040104, "QueryStatus failed: %08x\n", hres
);
2676 ok(cmds
[0].cmdf
== 0xdeadbeef, "OLECMDID_SPELL cmdf = %x\n", cmds
[0].cmdf
);
2677 ok(cmds
[1].cmdf
== 0xdeadbeef, "OLECMDID_REFRESH cmdf = %x\n", cmds
[0].cmdf
);
2680 IOleCommandTarget_Release(cmdtrg
);
2683 static void test_IServiceProvider(IUnknown
*unk
)
2685 IServiceProvider
*servprov
= (void*)0xdeadbeef;
2687 IUnknown
*ret
= NULL
;
2689 hres
= IUnknown_QueryInterface(unk
, &IID_IServiceProvider
, (void**)&servprov
);
2690 ok(hres
== S_OK
, "QueryInterface returned %08x, expected S_OK\n", hres
);
2694 hres
= IServiceProvider_QueryService(servprov
, &SID_STopLevelBrowser
, &IID_IBrowserService2
, (LPVOID
*)&ret
);
2695 ok(hres
== E_FAIL
, "QueryService returned %08x, expected E_FAIL\n", hres
);
2696 ok(ret
== NULL
, "ret returned %p, expected NULL\n", ret
);
2699 IUnknown_Release(ret
);
2702 IServiceProvider_Release(servprov
);
2705 static void test_put_href(IUnknown
*unk
)
2707 IHTMLLocation
*location
;
2708 IHTMLDocument2
*doc
;
2709 IDispatch
*doc_disp
;
2713 doc_disp
= get_document(unk
);
2715 hres
= IDispatch_QueryInterface(doc_disp
, &IID_IHTMLDocument2
, (void**)&doc
);
2716 IDispatch_Release(doc_disp
);
2717 ok(hres
== S_OK
, "QueryInterface(IID_IHTMLDocument2 failed: %08x\n", hres
);
2720 hres
= IHTMLDocument2_get_location(doc
, &location
);
2721 IHTMLDocument2_Release(doc
);
2722 ok(hres
== S_OK
, "get_location failed: %08x\n", hres
);
2723 ok(location
!= NULL
, "location == NULL\n");
2725 SET_EXPECT(TranslateUrl
);
2726 SET_EXPECT(Invoke_BEFORENAVIGATE2
);
2727 SET_EXPECT(Invoke_PROPERTYCHANGE
);
2729 dwl_flags
= DWL_FROM_PUT_HREF
;
2731 str
= a2bstr("about:test");
2732 current_url
= "about:test";
2733 is_first_load
= FALSE
;
2734 hres
= IHTMLLocation_put_href(location
, str
);
2736 CHECK_CALLED(TranslateUrl
);
2737 CHECK_CALLED(Invoke_BEFORENAVIGATE2
);
2738 todo_wine
CHECK_CALLED(Invoke_PROPERTYCHANGE
);
2740 IHTMLLocation_Release(location
);
2742 ok(hres
== S_OK
, "put_href failed: %08x\n", hres
);
2744 test_ready_state(READYSTATE_COMPLETE
);
2747 static void test_QueryInterface(IUnknown
*unk
)
2749 IQuickActivate
*qa
= (IQuickActivate
*)0xdeadbeef;
2750 IRunnableObject
*runnable
= (IRunnableObject
*)0xdeadbeef;
2751 IPerPropertyBrowsing
*propbrowse
= (void*)0xdeadbeef;
2752 IOleInPlaceSite
*inplace
= (void*)0xdeadbeef;
2753 IOleCache
*cache
= (void*)0xdeadbeef;
2754 IObjectWithSite
*site
= (void*)0xdeadbeef;
2755 IViewObjectEx
*viewex
= (void*)0xdeadbeef;
2756 IOleLink
*link
= (void*)0xdeadbeef;
2757 IMarshal
*marshal
= (void*)0xdeadbeef;
2758 IStdMarshalInfo
*marshalinfo
= (void*)0xdeadbeef;
2761 hres
= IUnknown_QueryInterface(unk
, &IID_IQuickActivate
, (void**)&qa
);
2762 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2763 ok(qa
== NULL
, "qa=%p, expected NULL\n", qa
);
2765 hres
= IUnknown_QueryInterface(unk
, &IID_IRunnableObject
, (void**)&runnable
);
2766 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2767 ok(runnable
== NULL
, "runnable=%p, expected NULL\n", runnable
);
2769 hres
= IUnknown_QueryInterface(unk
, &IID_IPerPropertyBrowsing
, (void**)&propbrowse
);
2770 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2771 ok(propbrowse
== NULL
, "propbrowse=%p, expected NULL\n", propbrowse
);
2773 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCache
, (void**)&cache
);
2774 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2775 ok(cache
== NULL
, "cache=%p, expected NULL\n", cache
);
2777 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceSite
, (void**)&inplace
);
2778 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2779 ok(inplace
== NULL
, "inplace=%p, expected NULL\n", inplace
);
2781 hres
= IUnknown_QueryInterface(unk
, &IID_IObjectWithSite
, (void**)&site
);
2782 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2783 ok(site
== NULL
, "site=%p, expected NULL\n", site
);
2785 hres
= IUnknown_QueryInterface(unk
, &IID_IViewObjectEx
, (void**)&viewex
);
2786 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2787 ok(viewex
== NULL
, "viewex=%p, expected NULL\n", viewex
);
2789 hres
= IUnknown_QueryInterface(unk
, &IID_IOleLink
, (void**)&link
);
2790 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2791 ok(link
== NULL
, "link=%p, expected NULL\n", link
);
2793 hres
= IUnknown_QueryInterface(unk
, &IID_IMarshal
, (void**)&marshal
);
2794 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2795 ok(marshal
== NULL
, "marshal=%p, expected NULL\n", marshal
);
2797 hres
= IUnknown_QueryInterface(unk
, &IID_IStdMarshalInfo
, (void**)&marshalinfo
);
2798 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2799 ok(marshalinfo
== NULL
, "marshalinfo=%p, expected NULL\n", marshalinfo
);
2803 static void test_UIActivate(IUnknown
*unk
, BOOL activate
)
2805 IOleDocumentView
*docview
;
2809 disp
= get_document(unk
);
2811 hres
= IDispatch_QueryInterface(disp
, &IID_IOleDocumentView
, (void**)&docview
);
2812 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2813 if(SUCCEEDED(hres
)) {
2815 SET_EXPECT(RequestUIActivate
);
2818 SET_EXPECT(OnFocus
);
2821 hres
= IOleDocumentView_UIActivate(docview
, activate
);
2823 todo_wine
ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2825 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2829 CHECK_CALLED(RequestUIActivate
);
2830 CHECK_CALLED(ShowUI
);
2831 CHECK_CALLED(HideUI
);
2832 CHECK_CALLED(OnFocus
);
2836 IOleDocumentView_Release(docview
);
2839 IDispatch_Release(disp
);
2842 static void test_TranslateAccelerator(IUnknown
*unk
)
2844 IOleClientSite
*doc_clientsite
;
2845 IOleInPlaceActiveObject
*pao
;
2855 test_Navigate2(unk
);
2857 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceActiveObject
, (void**)&pao
);
2858 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2859 if(SUCCEEDED(hres
)) {
2860 /* One accelerator that should be handled by mshtml */
2861 msg_a
.message
= WM_KEYDOWN
;
2862 msg_a
.wParam
= VK_F1
;
2863 hres
= IOleInPlaceActiveObject_TranslateAccelerator(pao
, &msg_a
);
2864 ok(hres
== S_FALSE
, "Got 0x%08x (%04x::%02lx)\n", hres
, msg_a
.message
, msg_a
.wParam
);
2866 /* And one that should not */
2867 msg_a
.message
= WM_KEYDOWN
;
2868 msg_a
.wParam
= VK_F5
;
2869 hres
= IOleInPlaceActiveObject_TranslateAccelerator(pao
, &msg_a
);
2870 ok(hres
== S_FALSE
, "Got 0x%08x (%04x::%02lx)\n", hres
, msg_a
.message
, msg_a
.wParam
);
2872 IOleInPlaceActiveObject_Release(pao
);
2875 test_UIActivate(unk
, TRUE
);
2877 /* Test again after UIActivate */
2878 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceActiveObject
, (void**)&pao
);
2879 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2880 if(SUCCEEDED(hres
)) {
2881 /* One accelerator that should be handled by mshtml */
2882 msg_a
.message
= WM_KEYDOWN
;
2883 msg_a
.wParam
= VK_F1
;
2884 SET_EXPECT(DocHost_TranslateAccelerator
);
2885 SET_EXPECT(ControlSite_TranslateAccelerator
);
2886 hres
= IOleInPlaceActiveObject_TranslateAccelerator(pao
, &msg_a
);
2887 ok(hres
== S_FALSE
, "Got 0x%08x (%04x::%02lx)\n", hres
, msg_a
.message
, msg_a
.wParam
);
2888 todo_wine
CHECK_CALLED(DocHost_TranslateAccelerator
);
2889 todo_wine
CHECK_CALLED(ControlSite_TranslateAccelerator
);
2891 /* And one that should not */
2892 msg_a
.message
= WM_KEYDOWN
;
2893 msg_a
.wParam
= VK_F5
;
2894 SET_EXPECT(DocHost_TranslateAccelerator
);
2895 hres
= IOleInPlaceActiveObject_TranslateAccelerator(pao
, &msg_a
);
2896 todo_wine
ok(hres
== S_OK
, "Got 0x%08x (%04x::%02lx)\n", hres
, msg_a
.message
, msg_a
.wParam
);
2897 todo_wine
CHECK_CALLED(DocHost_TranslateAccelerator
);
2899 IOleInPlaceActiveObject_Release(pao
);
2902 doc_clientsite
= get_dochost(unk
);
2903 if(doc_clientsite
) {
2904 IDocHostUIHandler2
*dochost
;
2905 IOleControlSite
*doc_controlsite
;
2908 hres
= IOleClientSite_QueryInterface(doc_clientsite
, &IID_IOleInPlaceFrame
, (void**)&unk_test
);
2909 ok(hres
== E_NOINTERFACE
, "Got 0x%08x\n", hres
);
2910 if(SUCCEEDED(hres
)) IUnknown_Release(unk_test
);
2912 hres
= IOleClientSite_QueryInterface(doc_clientsite
, &IID_IDocHostShowUI
, (void**)&unk_test
);
2913 todo_wine
ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2914 if(SUCCEEDED(hres
)) IUnknown_Release(unk_test
);
2916 hres
= IOleClientSite_QueryInterface(doc_clientsite
, &IID_IDocHostUIHandler
, (void**)&unk_test
);
2917 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2918 if(SUCCEEDED(hres
)) IUnknown_Release(unk_test
);
2920 hres
= IOleClientSite_QueryInterface(doc_clientsite
, &IID_IDocHostUIHandler2
, (void**)&dochost
);
2921 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2922 if(SUCCEEDED(hres
)) {
2923 msg_a
.message
= WM_KEYDOWN
;
2924 hr_dochost_TranslateAccelerator
= 0xdeadbeef;
2925 for(keycode
= 0; keycode
<= 0x100; keycode
++) {
2926 msg_a
.wParam
= keycode
;
2927 SET_EXPECT(DocHost_TranslateAccelerator
);
2928 hres
= IDocHostUIHandler_TranslateAccelerator(dochost
, &msg_a
, &CGID_MSHTML
, 1234);
2929 ok(hres
== 0xdeadbeef, "Got 0x%08x\n", hres
);
2930 CHECK_CALLED(DocHost_TranslateAccelerator
);
2932 hr_dochost_TranslateAccelerator
= E_NOTIMPL
;
2934 SET_EXPECT(DocHost_TranslateAccelerator
);
2935 hres
= IDocHostUIHandler_TranslateAccelerator(dochost
, &msg_a
, &CGID_MSHTML
, 1234);
2936 ok(hres
== E_NOTIMPL
, "Got 0x%08x\n", hres
);
2937 CHECK_CALLED(DocHost_TranslateAccelerator
);
2939 IDocHostUIHandler2_Release(dochost
);
2942 hres
= IOleClientSite_QueryInterface(doc_clientsite
, &IID_IOleControlSite
, (void**)&doc_controlsite
);
2943 ok(hres
== S_OK
, "Got 0x%08x\n", hres
);
2944 if(SUCCEEDED(hres
)) {
2945 msg_a
.message
= WM_KEYDOWN
;
2946 hr_site_TranslateAccelerator
= 0xdeadbeef;
2947 for(keycode
= 0; keycode
< 0x100; keycode
++) {
2948 msg_a
.wParam
= keycode
;
2949 SET_EXPECT(ControlSite_TranslateAccelerator
);
2950 hres
= IOleControlSite_TranslateAccelerator(doc_controlsite
, &msg_a
, 0);
2951 if(keycode
== 0x9 || keycode
== 0x75)
2952 todo_wine
ok(hres
== S_OK
, "Got 0x%08x (keycode: %04x)\n", hres
, keycode
);
2954 ok(hres
== S_FALSE
, "Got 0x%08x (keycode: %04x)\n", hres
, keycode
);
2956 CHECK_CALLED(ControlSite_TranslateAccelerator
);
2958 msg_a
.wParam
= VK_LEFT
;
2959 SET_EXPECT(ControlSite_TranslateAccelerator
);
2960 hres
= IOleControlSite_TranslateAccelerator(doc_controlsite
, &msg_a
, 0);
2961 ok(hres
== S_FALSE
, "Got 0x%08x (keycode: %04x)\n", hres
, keycode
);
2962 CHECK_CALLED(ControlSite_TranslateAccelerator
);
2964 hr_site_TranslateAccelerator
= S_OK
;
2965 SET_EXPECT(ControlSite_TranslateAccelerator
);
2966 hres
= IOleControlSite_TranslateAccelerator(doc_controlsite
, &msg_a
, 0);
2967 ok(hres
== S_OK
, "Got 0x%08x (keycode: %04x)\n", hres
, keycode
);
2968 CHECK_CALLED(ControlSite_TranslateAccelerator
);
2970 hr_site_TranslateAccelerator
= E_NOTIMPL
;
2971 SET_EXPECT(ControlSite_TranslateAccelerator
);
2972 hres
= IOleControlSite_TranslateAccelerator(doc_controlsite
, &msg_a
, 0);
2973 ok(hres
== S_FALSE
, "Got 0x%08x (keycode: %04x)\n", hres
, keycode
);
2974 CHECK_CALLED(ControlSite_TranslateAccelerator
);
2976 IOleControlSite_Release(doc_controlsite
);
2979 IOleClientSite_Release(doc_clientsite
);
2982 test_UIActivate(unk
, FALSE
);
2985 static void test_dochost_qs(IUnknown
*unk
)
2987 IOleClientSite
*client_site
;
2988 IServiceProvider
*serv_prov
;
2992 client_site
= get_dochost(unk
);
2993 hres
= IOleClientSite_QueryInterface(client_site
, &IID_IServiceProvider
, (void**)&serv_prov
);
2994 IOleClientSite_Release(client_site
);
2995 ok(hres
== S_OK
, "Could not get IServiceProvider iface: %08x\n", hres
);
2997 hres
= IServiceProvider_QueryService(serv_prov
, &IID_IHlinkFrame
, &IID_IHlinkFrame
, (void**)&service
);
2998 ok(hres
== S_OK
, "QueryService failed: %08x\n", hres
);
2999 ok(iface_cmp(service
, unk
), "service != unk\n");
3000 IUnknown_Release(service
);
3002 hres
= IServiceProvider_QueryService(serv_prov
, &IID_IWebBrowserApp
, &IID_IHlinkFrame
, (void**)&service
);
3003 ok(hres
== S_OK
, "QueryService failed: %08x\n", hres
);
3004 ok(iface_cmp(service
, unk
), "service != unk\n");
3005 IUnknown_Release(service
);
3007 hres
= IServiceProvider_QueryService(serv_prov
, &IID_IShellBrowser
, &IID_IShellBrowser
, (void**)&service
);
3008 ok(hres
== S_OK
, "QueryService failed: %08x\n", hres
);
3009 IUnknown_Release(service
);
3011 hres
= IServiceProvider_QueryService(serv_prov
, &IID_IShellBrowser
, &IID_IBrowserService
, (void**)&service
);
3012 ok(hres
== S_OK
, "QueryService failed: %08x\n", hres
);
3013 IUnknown_Release(service
);
3015 hres
= IServiceProvider_QueryService(serv_prov
, &IID_IShellBrowser
, &IID_IDocObjectService
, (void**)&service
);
3016 ok(hres
== S_OK
, "QueryService failed: %08x\n", hres
);
3017 IUnknown_Release(service
);
3019 IServiceProvider_Release(serv_prov
);
3022 static void test_Close(IWebBrowser2
*wb
, BOOL do_download
)
3025 IOleClientSite
*ocs
;
3028 hres
= IWebBrowser2_QueryInterface(wb
, &IID_IOleObject
, (void**)&oo
);
3029 ok(hres
== S_OK
, "QueryInterface failed: %08x\n", hres
);
3035 SET_EXPECT(Frame_SetActiveObject
);
3036 SET_EXPECT(UIWindow_SetActiveObject
);
3037 SET_EXPECT(OnUIDeactivate
);
3038 SET_EXPECT(OnFocus
);
3039 SET_EXPECT(OnInPlaceDeactivate
);
3041 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
3042 SET_EXPECT(Invoke_DOWNLOADCOMPLETE
);
3044 hres
= IOleObject_Close(oo
, OLECLOSE_NOSAVE
);
3045 ok(hres
== S_OK
, "OleObject_Close failed: %x\n", hres
);
3046 CHECK_CALLED(Frame_SetActiveObject
);
3047 CHECK_CALLED(UIWindow_SetActiveObject
);
3048 CHECK_CALLED(OnUIDeactivate
);
3049 todo_wine
CHECK_CALLED(OnFocus
);
3050 CHECK_CALLED(OnInPlaceDeactivate
);
3052 todo_wine
CHECK_CALLED(Invoke_COMMANDSTATECHANGE
);
3053 todo_wine
CHECK_CALLED(Invoke_DOWNLOADCOMPLETE
);
3056 hres
= IOleObject_GetClientSite(oo
, &ocs
);
3057 ok(hres
== S_OK
, "hres = %x\n", hres
);
3058 ok(!ocs
, "ocs != NULL\n");
3060 hres
= IOleObject_Close(oo
, OLECLOSE_NOSAVE
);
3061 ok(hres
== S_OK
, "OleObject_Close failed: %x\n", hres
);
3064 IOleObject_Release(oo
);
3067 static void test_WebBrowser(BOOL do_download
, BOOL do_close
)
3069 IUnknown
*unk
= NULL
;
3073 if (FAILED(create_WebBrowser(&unk
)))
3076 is_downloading
= FALSE
;
3077 is_first_load
= TRUE
;
3078 use_container_olecmd
= TRUE
;
3080 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
3081 ok(hres
== S_OK
, "Could not get IWebBrowser2 iface: %08x\n", hres
);
3083 test_QueryStatusWB(wb
, FALSE
, FALSE
);
3084 test_ExecWB(wb
, FALSE
, FALSE
);
3085 test_QueryInterface(unk
);
3086 test_ready_state(READYSTATE_UNINITIALIZED
);
3087 test_ClassInfo(unk
);
3088 test_LocationURL(unk
, "");
3089 test_ConnectionPoint(unk
, TRUE
);
3090 test_ClientSite(unk
, &ClientSite
, !do_download
);
3092 test_wb_funcs(unk
, TRUE
);
3094 test_olecmd(unk
, FALSE
);
3095 test_Navigate2(unk
);
3096 test_QueryStatusWB(wb
, TRUE
, TRUE
);
3097 test_ExecWB(wb
, TRUE
, TRUE
);
3100 IDispatch
*doc
, *doc2
;
3103 test_olecmd(unk
, TRUE
);
3104 doc
= get_document(unk
);
3107 test_download(DWL_FROM_PUT_HREF
);
3108 doc2
= get_document(unk
);
3109 ok(doc
== doc2
, "doc != doc2\n");
3110 IDispatch_Release(doc2
);
3112 test_Navigate2(unk
);
3113 test_download(DWL_EXPECT_BEFORE_NAVIGATE
);
3114 test_TranslateAccelerator(unk
);
3115 doc2
= get_document(unk
);
3116 ok(doc
== doc2
, "doc != doc2\n");
3117 IDispatch_Release(doc2
);
3118 IDispatch_Release(doc2
);
3120 test_dochost_qs(unk
);
3124 test_Close(wb
, do_download
);
3126 test_ClientSite(unk
, NULL
, !do_download
);
3128 test_GetControlInfo(unk
);
3129 test_wb_funcs(unk
, FALSE
);
3130 test_ConnectionPoint(unk
, FALSE
);
3131 test_IServiceProvider(unk
);
3133 IWebBrowser2_Release(wb
);
3134 ref
= IUnknown_Release(unk
);
3135 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3138 static void test_WebBrowser_NoContainerOlecmd(void)
3140 IUnknown
*unk
= NULL
;
3144 is_downloading
= FALSE
;
3145 is_first_load
= TRUE
;
3146 use_container_olecmd
= FALSE
;
3149 if (FAILED(create_WebBrowser(&unk
)))
3151 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
3152 ok(hres
== S_OK
, "QueryInterface(IID_IWebBrowser) failed: %08x\n", hres
);
3155 test_ConnectionPoint(unk
, TRUE
);
3156 test_ClientSite(unk
, &ClientSite
, TRUE
);
3158 test_Navigate2(unk
);
3160 /* Tests of interest */
3161 test_QueryStatusWB(wb
, FALSE
, TRUE
);
3162 test_ExecWB(wb
, FALSE
, TRUE
);
3165 IWebBrowser2_Release(wb
);
3166 test_ClientSite(unk
, NULL
, TRUE
);
3167 test_ConnectionPoint(unk
, FALSE
);
3168 ref
= IUnknown_Release(unk
);
3169 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3172 START_TEST(webbrowser
)
3174 OleInitialize(NULL
);
3176 container_hwnd
= create_container_window();
3178 trace("Testing WebBrowser (no download)...\n");
3179 test_WebBrowser(FALSE
, FALSE
);
3180 test_WebBrowser(FALSE
, TRUE
);
3181 trace("Testing WebBrowser...\n");
3182 test_WebBrowser(TRUE
, FALSE
);
3183 test_WebBrowser(TRUE
, TRUE
);
3184 trace("Testing WebBrowser w/o container-based olecmd...\n");
3185 test_WebBrowser_NoContainerOlecmd();