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>
40 DEFINE_GUID(GUID_NULL
,0,0,0,0,0,0,0,0,0,0,0);
42 #define DEFINE_EXPECT(func) \
43 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
45 #define SET_EXPECT(func) \
46 expect_ ## func = TRUE
48 #define CHECK_EXPECT2(func) \
50 ok(expect_ ##func, "unexpected call " #func "\n"); \
51 called_ ## func = TRUE; \
54 #define CHECK_EXPECT(func) \
56 CHECK_EXPECT2(func); \
57 expect_ ## func = FALSE; \
60 #define CHECK_CALLED(func) \
62 ok(called_ ## func, "expected " #func "\n"); \
63 expect_ ## func = called_ ## func = FALSE; \
66 #define CHECK_CALLED_BROKEN(func) \
68 ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
69 expect_ ## func = called_ ## func = FALSE; \
72 DEFINE_EXPECT(GetContainer
);
73 DEFINE_EXPECT(Site_GetWindow
);
74 DEFINE_EXPECT(ShowObject
);
75 DEFINE_EXPECT(CanInPlaceActivate
);
76 DEFINE_EXPECT(OnInPlaceActivate
);
77 DEFINE_EXPECT(OnUIActivate
);
78 DEFINE_EXPECT(GetWindowContext
);
79 DEFINE_EXPECT(Frame_GetWindow
);
80 DEFINE_EXPECT(Frame_SetActiveObject
);
81 DEFINE_EXPECT(UIWindow_SetActiveObject
);
82 DEFINE_EXPECT(SetMenu
);
83 DEFINE_EXPECT(Invoke_AMBIENT_USERMODE
);
84 DEFINE_EXPECT(Invoke_AMBIENT_DLCONTROL
);
85 DEFINE_EXPECT(Invoke_AMBIENT_USERAGENT
);
86 DEFINE_EXPECT(Invoke_AMBIENT_PALETTE
);
87 DEFINE_EXPECT(Invoke_AMBIENT_SILENT
);
88 DEFINE_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
89 DEFINE_EXPECT(Invoke_STATUSTEXTCHANGE
);
90 DEFINE_EXPECT(Invoke_PROPERTYCHANGE
);
91 DEFINE_EXPECT(Invoke_DOWNLOADBEGIN
);
92 DEFINE_EXPECT(Invoke_BEFORENAVIGATE2
);
93 DEFINE_EXPECT(Invoke_SETSECURELOCKICON
);
94 DEFINE_EXPECT(Invoke_FILEDOWNLOAD
);
95 DEFINE_EXPECT(Invoke_COMMANDSTATECHANGE
);
96 DEFINE_EXPECT(Invoke_DOWNLOADCOMPLETE
);
97 DEFINE_EXPECT(Invoke_ONMENUBAR
);
98 DEFINE_EXPECT(Invoke_ONADDRESSBAR
);
99 DEFINE_EXPECT(Invoke_ONSTATUSBAR
);
100 DEFINE_EXPECT(Invoke_ONTOOLBAR
);
101 DEFINE_EXPECT(Invoke_ONFULLSCREEN
);
102 DEFINE_EXPECT(Invoke_ONTHEATERMODE
);
103 DEFINE_EXPECT(Invoke_WINDOWSETRESIZABLE
);
104 DEFINE_EXPECT(EnableModeless_TRUE
);
105 DEFINE_EXPECT(EnableModeless_FALSE
);
106 DEFINE_EXPECT(GetHostInfo
);
107 DEFINE_EXPECT(GetOptionKeyPath
);
108 DEFINE_EXPECT(GetOverridesKeyPath
);
109 DEFINE_EXPECT(SetStatusText
);
110 DEFINE_EXPECT(UpdateUI
);
111 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_0
);
112 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_1
);
113 DEFINE_EXPECT(Exec_SETPROGRESSMAX
);
114 DEFINE_EXPECT(Exec_SETPROGRESSPOS
);
115 DEFINE_EXPECT(QueryStatus_SETPROGRESSTEXT
);
117 static const WCHAR wszItem
[] = {'i','t','e','m',0};
118 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
119 static const WCHAR emptyW
[] = {0};
121 static VARIANT_BOOL exvb
;
122 static IWebBrowser2
*wb
;
124 static HWND container_hwnd
, shell_embedding_hwnd
;
126 static const char *debugstr_w(LPCWSTR str
)
128 static char buf
[1024];
131 WideCharToMultiByte(CP_ACP
, 0, str
, -1, buf
, sizeof(buf
), NULL
, NULL
);
135 static const char *debugstr_guid(REFIID riid
)
139 sprintf(buf
, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
140 riid
->Data1
, riid
->Data2
, riid
->Data3
, riid
->Data4
[0],
141 riid
->Data4
[1], riid
->Data4
[2], riid
->Data4
[3], riid
->Data4
[4],
142 riid
->Data4
[5], riid
->Data4
[6], riid
->Data4
[7]);
147 #define test_LocationURL(a,b) _test_LocationURL(__LINE__,a,b)
148 static void _test_LocationURL(unsigned line
, IUnknown
*unk
, LPCWSTR exurl
)
151 BSTR url
= (void*)0xdeadbeef;
154 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
155 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
159 hres
= IWebBrowser2_get_LocationURL(wb
, &url
);
160 ok_(__FILE__
,line
) (hres
== (*exurl
? S_OK
: S_FALSE
), "get_LocationURL failed: %08x\n", hres
);
161 ok_(__FILE__
,line
) (!lstrcmpW(url
, exurl
), "unexpected URL: %s\n", debugstr_w(url
));
164 IWebBrowser2_Release(wb
);
167 static HRESULT
QueryInterface(REFIID
,void**);
169 static HRESULT WINAPI
OleCommandTarget_QueryInterface(IOleCommandTarget
*iface
,
170 REFIID riid
, void **ppv
)
172 ok(0, "unexpected call\n");
173 return E_NOINTERFACE
;
176 static ULONG WINAPI
OleCommandTarget_AddRef(IOleCommandTarget
*iface
)
181 static ULONG WINAPI
OleCommandTarget_Release(IOleCommandTarget
*iface
)
186 static HRESULT WINAPI
OleCommandTarget_QueryStatus(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
187 ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
*pCmdText
)
189 ok(!pguidCmdGroup
, "pguidCmdGroup != MULL\n");
190 ok(cCmds
== 1, "cCmds=%d, expected 1\n", cCmds
);
191 ok(!pCmdText
, "pCmdText != NULL\n");
193 switch(prgCmds
[0].cmdID
) {
194 case OLECMDID_SETPROGRESSTEXT
:
195 CHECK_EXPECT(QueryStatus_SETPROGRESSTEXT
);
196 prgCmds
[0].cmdf
= OLECMDF_ENABLED
;
199 ok(0, "unexpected command %d\n", prgCmds
[0].cmdID
);
205 static HRESULT WINAPI
OleCommandTarget_Exec(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
206 DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
210 case OLECMDID_SETPROGRESSMAX
:
211 CHECK_EXPECT(Exec_SETPROGRESSMAX
);
212 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
213 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
215 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
216 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
218 case OLECMDID_SETPROGRESSPOS
:
219 CHECK_EXPECT(Exec_SETPROGRESSPOS
);
220 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
221 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
223 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
224 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
226 case OLECMDID_SETDOWNLOADSTATE
:
227 ok(!nCmdexecopt
, "nCmdexecopts=%08x\n", nCmdexecopt
);
228 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
229 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
230 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d\n", V_VT(pvaIn
));
231 switch(V_I4(pvaIn
)) {
233 CHECK_EXPECT(Exec_SETDOWNLOADSTATE_0
);
236 CHECK_EXPECT2(Exec_SETDOWNLOADSTATE_1
);
239 ok(0, "unexpevted V_I4(pvaIn)=%d\n", V_I4(pvaIn
));
243 ok(0, "unexpected nsCmdID %d\n", nCmdID
);
245 }else if(IsEqualGUID(&CGID_Explorer
, pguidCmdGroup
)) {
248 return E_FAIL
; /* TODO */
250 return E_FAIL
; /* IE5 */
252 return E_FAIL
; /* TODO */
254 ok(0, "unexpected nCmdID %d\n", nCmdID
);
257 ok(0, "unepected pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup
));
263 static IOleCommandTargetVtbl OleCommandTargetVtbl
= {
264 OleCommandTarget_QueryInterface
,
265 OleCommandTarget_AddRef
,
266 OleCommandTarget_Release
,
267 OleCommandTarget_QueryStatus
,
268 OleCommandTarget_Exec
271 static IOleCommandTarget OleCommandTarget
= { &OleCommandTargetVtbl
};
273 static HRESULT WINAPI
OleContainer_QueryInterface(IOleContainer
*iface
, REFIID riid
, void **ppv
)
275 if(IsEqualGUID(&IID_ITargetContainer
, riid
))
276 return E_NOINTERFACE
; /* TODO */
278 if(IsEqualGUID(&IID_IOleCommandTarget
, riid
)) {
279 *ppv
= &OleCommandTarget
;
283 ok(0, "unexpected call\n");
284 return E_NOINTERFACE
;
287 static ULONG WINAPI
OleContainer_AddRef(IOleContainer
*iface
)
292 static ULONG WINAPI
OleContainer_Release(IOleContainer
*iface
)
297 static HRESULT WINAPI
OleContainer_ParseDisplayName(IOleContainer
*iface
, IBindCtx
*pbc
,
298 LPOLESTR pszDiaplayName
, ULONG
*pchEaten
, IMoniker
**ppmkOut
)
300 ok(0, "unexpected call\n");
304 static HRESULT WINAPI
OleContainer_EnumObjects(IOleContainer
*iface
, DWORD grfFlags
,
305 IEnumUnknown
**ppenum
)
307 ok(0, "unexpected call\n");
311 static HRESULT WINAPI
OleContainer_LockContainer(IOleContainer
*iface
, BOOL fLock
)
313 ok(0, "unexpected call\n");
317 static const IOleContainerVtbl OleContainerVtbl
= {
318 OleContainer_QueryInterface
,
320 OleContainer_Release
,
321 OleContainer_ParseDisplayName
,
322 OleContainer_EnumObjects
,
323 OleContainer_LockContainer
326 static IOleContainer OleContainer
= { &OleContainerVtbl
};
328 static HRESULT WINAPI
Dispatch_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
330 return QueryInterface(riid
, ppv
);
333 static ULONG WINAPI
Dispatch_AddRef(IDispatch
*iface
)
338 static ULONG WINAPI
Dispatch_Release(IDispatch
*iface
)
343 static HRESULT WINAPI
Dispatch_GetTypeInfoCount(IDispatch
*iface
, UINT
*pctinfo
)
345 ok(0, "unexpected call\n");
349 static HRESULT WINAPI
Dispatch_GetTypeInfo(IDispatch
*iface
, UINT iTInfo
, LCID lcid
,
352 ok(0, "unexpected call\n");
356 static HRESULT WINAPI
Dispatch_GetIDsOfNames(IDispatch
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
357 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
359 ok(0, "unexpected call\n");
363 static HRESULT WINAPI
Dispatch_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
364 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
365 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
367 ok(IsEqualGUID(&IID_NULL
, riid
), "riid != IID_NULL\n");
368 ok(pDispParams
!= NULL
, "pDispParams == NULL\n");
369 ok(pExcepInfo
== NULL
, "pExcepInfo=%p, expected NULL\n", pExcepInfo
);
370 ok(V_VT(pVarResult
) == VT_EMPTY
, "V_VT(pVarResult)=%d\n", V_VT(pVarResult
));
371 ok(wFlags
== DISPATCH_PROPERTYGET
, "wFlags=%08x, expected DISPATCH_PROPERTYGET\n", wFlags
);
372 ok(pDispParams
->rgvarg
== NULL
, "pDispParams->rgvarg = %p\n", pDispParams
->rgvarg
);
373 ok(pDispParams
->rgdispidNamedArgs
== NULL
,
374 "pDispParams->rgdispidNamedArgs = %p\n", pDispParams
->rgdispidNamedArgs
);
375 ok(pDispParams
->cArgs
== 0, "pDispParams->cArgs = %d\n", pDispParams
->cArgs
);
376 ok(pDispParams
->cNamedArgs
== 0, "pDispParams->cNamedArgs = %d\n", pDispParams
->cNamedArgs
);
378 switch(dispIdMember
) {
379 case DISPID_AMBIENT_USERMODE
:
380 CHECK_EXPECT2(Invoke_AMBIENT_USERMODE
);
382 case DISPID_AMBIENT_DLCONTROL
:
383 CHECK_EXPECT(Invoke_AMBIENT_DLCONTROL
);
384 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
386 case DISPID_AMBIENT_USERAGENT
:
387 CHECK_EXPECT(Invoke_AMBIENT_USERAGENT
);
388 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
390 case DISPID_AMBIENT_PALETTE
:
391 CHECK_EXPECT(Invoke_AMBIENT_PALETTE
);
392 ok(puArgErr
!= NULL
, "puArgErr=%p\n", puArgErr
);
394 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
:
395 CHECK_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
396 ok(puArgErr
== NULL
, "puArgErr=%p\n", puArgErr
);
397 V_VT(pVarResult
) = VT_BOOL
;
398 V_BOOL(pVarResult
) = VARIANT_FALSE
;
400 case DISPID_AMBIENT_SILENT
:
401 CHECK_EXPECT(Invoke_AMBIENT_SILENT
);
402 ok(puArgErr
== NULL
, "puArgErr=%p\n", puArgErr
);
403 V_VT(pVarResult
) = VT_BOOL
;
404 V_BOOL(pVarResult
) = VARIANT_FALSE
;
408 ok(0, "unexpected dispIdMember %d\n", dispIdMember
);
412 static IDispatchVtbl DispatchVtbl
= {
413 Dispatch_QueryInterface
,
416 Dispatch_GetTypeInfoCount
,
417 Dispatch_GetTypeInfo
,
418 Dispatch_GetIDsOfNames
,
422 static IDispatch Dispatch
= { &DispatchVtbl
};
424 static HRESULT WINAPI
WebBrowserEvents2_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
428 if(IsEqualGUID(&DIID_DWebBrowserEvents2
, riid
)) {
433 ok(0, "unexpected riid %s\n", debugstr_guid(riid
));
434 return E_NOINTERFACE
;
437 #define test_invoke_bool(p,s) _test_invoke_bool(__LINE__,p,s)
438 static void _test_invoke_bool(unsigned line
, const DISPPARAMS
*params
, BOOL strict
)
440 ok_(__FILE__
,line
) (params
->rgvarg
!= NULL
, "rgvarg == NULL\n");
441 ok_(__FILE__
,line
) (params
->cArgs
== 1, "cArgs=%d, expected 1\n", params
->cArgs
);
442 ok_(__FILE__
,line
) (V_VT(params
->rgvarg
) == VT_BOOL
, "V_VT(arg)=%d\n", V_VT(params
->rgvarg
));
444 ok_(__FILE__
,line
) (V_BOOL(params
->rgvarg
) == exvb
, "V_VT(arg)=%x, expected %x\n",
445 V_BOOL(params
->rgvarg
), exvb
);
447 ok_(__FILE__
,line
) (!V_BOOL(params
->rgvarg
) == !exvb
, "V_VT(arg)=%x, expected %x\n",
448 V_BOOL(params
->rgvarg
), exvb
);
451 static void test_OnBeforeNavigate(const VARIANT
*disp
, const VARIANT
*url
, const VARIANT
*flags
,
452 const VARIANT
*frame
, const VARIANT
*post_data
, const VARIANT
*headers
, const VARIANT
*cancel
)
454 ok(V_VT(disp
) == VT_DISPATCH
, "V_VT(disp)=%d, expected VT_DISPATCH\n", V_VT(disp
));
455 ok(V_DISPATCH(disp
) != NULL
, "V_DISPATCH(disp) == NULL\n");
456 ok(V_DISPATCH(disp
) == (IDispatch
*)wb
, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp
), wb
);
458 ok(V_VT(url
) == (VT_BYREF
|VT_VARIANT
), "V_VT(url)=%x, expected VT_BYREF|VT_VARIANT\n", V_VT(url
));
459 ok(V_VARIANTREF(url
) != NULL
, "V_VARIANTREF(url) == NULL)\n");
460 if(V_VARIANTREF(url
)) {
461 ok(V_VT(V_VARIANTREF(url
)) == VT_BSTR
, "V_VT(V_VARIANTREF(url))=%d, expected VT_BSTR\n",
462 V_VT(V_VARIANTREF(url
)));
463 ok(V_BSTR(V_VARIANTREF(url
)) != NULL
, "V_BSTR(V_VARIANTREF(url)) == NULL\n");
464 ok(!lstrcmpW(V_BSTR(V_VARIANTREF(url
)), about_blankW
), "unexpected url %s\n",
465 debugstr_w(V_BSTR(V_VARIANTREF(url
))));
468 ok(V_VT(flags
) == (VT_BYREF
|VT_VARIANT
), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n",
470 ok(V_VT(flags
) == (VT_BYREF
|VT_VARIANT
), "V_VT(flags)=%x, expected VT_BYREF|VT_VARIANT\n",
472 ok(V_VARIANTREF(flags
) != NULL
, "V_VARIANTREF(flags) == NULL)\n");
473 if(V_VARIANTREF(flags
)) {
474 ok(V_VT(V_VARIANTREF(flags
)) == VT_I4
, "V_VT(V_VARIANTREF(flags))=%d, expected VT_I4\n",
475 V_VT(V_VARIANTREF(flags
)));
476 ok(V_I4(V_VARIANTREF(flags
)) == 0, "V_I4(V_VARIANTREF(flags)) = %d, expected 0\n",
477 V_I4(V_VARIANTREF(flags
)));
480 ok(V_VT(frame
) == (VT_BYREF
|VT_VARIANT
), "V_VT(frame)=%x, expected VT_BYREF|VT_VARIANT\n",
482 ok(V_VT(frame
) == (VT_BYREF
|VT_VARIANT
), "V_VT(frame)=%x, expected VT_BYREF|VT_VARIANT\n",
484 ok(V_VARIANTREF(frame
) != NULL
, "V_VARIANTREF(frame) == NULL)\n");
485 if(V_VARIANTREF(frame
)) {
486 ok(V_VT(V_VARIANTREF(frame
)) == VT_BSTR
, "V_VT(V_VARIANTREF(frame))=%d, expected VT_BSTR\n",
487 V_VT(V_VARIANTREF(frame
)));
488 ok(V_BSTR(V_VARIANTREF(frame
)) == NULL
, "V_BSTR(V_VARIANTREF(frame)) = %p, expected NULL\n",
489 V_BSTR(V_VARIANTREF(frame
)));
492 ok(V_VT(post_data
) == (VT_BYREF
|VT_VARIANT
), "V_VT(post_data)=%x, expected VT_BYREF|VT_VARIANT\n",
494 ok(V_VT(post_data
) == (VT_BYREF
|VT_VARIANT
), "V_VT(post_data)=%x, expected VT_BYREF|VT_VARIANT\n",
496 ok(V_VARIANTREF(post_data
) != NULL
, "V_VARIANTREF(post_data) == NULL)\n");
497 if(V_VARIANTREF(post_data
)) {
498 ok(V_VT(V_VARIANTREF(post_data
)) == (VT_VARIANT
|VT_BYREF
),
499 "V_VT(V_VARIANTREF(post_data))=%d, expected VT_VARIANT|VT_BYREF\n",
500 V_VT(V_VARIANTREF(post_data
)));
501 ok(V_VARIANTREF(V_VARIANTREF(post_data
)) != NULL
,
502 "V_VARIANTREF(V_VARIANTREF(post_data)) == NULL\n");
503 if(V_VARIANTREF(V_VARIANTREF(post_data
))) {
504 ok(V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))) == VT_EMPTY
,
505 "V_VT(V_VARIANTREF(V_VARIANTREF(post_data))) = %d, expected VT_EMPTY\n",
506 V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))));
508 if(V_VT(V_VARIANTREF(V_VARIANTREF(post_data
))) == (VT_UI1
|VT_ARRAY
)) {
509 const SAFEARRAY
*sa
= V_ARRAY(V_VARIANTREF(V_VARIANTREF(post_data
)));
511 ok(sa
->cDims
== 1, "sa->cDims = %d, expected 1\n", sa
->cDims
);
512 ok(sa
->fFeatures
== 0, "sa->fFeatures = %d, expected 0\n", sa
->fFeatures
);
517 ok(V_VT(headers
) == (VT_BYREF
|VT_VARIANT
), "V_VT(headers)=%x, expected VT_BYREF|VT_VARIANT\n",
519 ok(V_VARIANTREF(headers
) != NULL
, "V_VARIANTREF(headers) == NULL)\n");
520 if(V_VARIANTREF(headers
)) {
521 ok(V_VT(V_VARIANTREF(headers
)) == VT_BSTR
, "V_VT(V_VARIANTREF(headers))=%d, expected VT_BSTR\n",
522 V_VT(V_VARIANTREF(headers
)));
523 ok(V_BSTR(V_VARIANTREF(headers
)) == NULL
, "V_BSTR(V_VARIANTREF(heders)) = %p, expected NULL\n",
524 V_BSTR(V_VARIANTREF(headers
)));
527 ok(V_VT(cancel
) == (VT_BYREF
|VT_BOOL
), "V_VT(cancel)=%x, expected VT_BYREF|VT_BOOL\n",
529 ok(V_BOOLREF(cancel
) != NULL
, "V_BOOLREF(pDispParams->rgvarg[0] == NULL)\n");
530 if(V_BOOLREF(cancel
))
531 ok(*V_BOOLREF(cancel
) == VARIANT_FALSE
, "*V_BOOLREF(calcel) = %x, expected VARIANT_FALSE\n",
535 static HRESULT WINAPI
WebBrowserEvents2_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
536 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
537 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
539 ok(IsEqualGUID(&IID_NULL
, riid
), "riid != IID_NULL\n");
540 ok(pDispParams
!= NULL
, "pDispParams == NULL\n");
541 ok(pExcepInfo
== NULL
, "pExcepInfo=%p, expected NULL\n", pExcepInfo
);
542 ok(pVarResult
== NULL
, "pVarResult=%p\n", pVarResult
);
543 ok(wFlags
== DISPATCH_METHOD
, "wFlags=%08x, expected DISPATCH_METHOD\n", wFlags
);
544 ok(pDispParams
->rgdispidNamedArgs
== NULL
,
545 "pDispParams->rgdispidNamedArgs = %p\n", pDispParams
->rgdispidNamedArgs
);
546 ok(pDispParams
->cNamedArgs
== 0, "pDispParams->cNamedArgs = %d\n", pDispParams
->cNamedArgs
);
548 switch(dispIdMember
) {
549 case DISPID_STATUSTEXTCHANGE
:
550 CHECK_EXPECT2(Invoke_STATUSTEXTCHANGE
);
552 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
553 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
554 ok(V_VT(pDispParams
->rgvarg
) == VT_BSTR
, "V_VT(pDispParams->rgvarg)=%d, expected VT_BSTR\n",
555 V_VT(pDispParams
->rgvarg
));
556 /* TODO: Check text */
559 case DISPID_PROPERTYCHANGE
:
560 CHECK_EXPECT2(Invoke_PROPERTYCHANGE
);
562 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
563 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
564 /* TODO: Check args */
567 case DISPID_DOWNLOADBEGIN
:
568 CHECK_EXPECT(Invoke_DOWNLOADBEGIN
);
570 ok(pDispParams
->rgvarg
== NULL
, "rgvarg=%p, expected NULL\n", pDispParams
->rgvarg
);
571 ok(pDispParams
->cArgs
== 0, "cArgs=%d, expected 0\n", pDispParams
->cArgs
);
574 case DISPID_BEFORENAVIGATE2
:
575 CHECK_EXPECT(Invoke_BEFORENAVIGATE2
);
577 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
578 ok(pDispParams
->cArgs
== 7, "cArgs=%d, expected 7\n", pDispParams
->cArgs
);
579 test_OnBeforeNavigate(pDispParams
->rgvarg
+6, pDispParams
->rgvarg
+5, pDispParams
->rgvarg
+4,
580 pDispParams
->rgvarg
+3, pDispParams
->rgvarg
+2, pDispParams
->rgvarg
+1,
581 pDispParams
->rgvarg
);
584 case DISPID_SETSECURELOCKICON
:
585 CHECK_EXPECT2(Invoke_SETSECURELOCKICON
);
587 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
588 ok(pDispParams
->cArgs
== 1, "cArgs=%d, expected 1\n", pDispParams
->cArgs
);
589 /* TODO: Check args */
592 case DISPID_FILEDOWNLOAD
:
593 CHECK_EXPECT(Invoke_FILEDOWNLOAD
);
595 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
596 ok(pDispParams
->cArgs
== 2, "cArgs=%d, expected 2\n", pDispParams
->cArgs
);
597 /* TODO: Check args */
600 case DISPID_COMMANDSTATECHANGE
:
601 CHECK_EXPECT2(Invoke_COMMANDSTATECHANGE
);
603 ok(pDispParams
->rgvarg
!= NULL
, "rgvarg == NULL\n");
604 ok(pDispParams
->cArgs
== 2, "cArgs=%d, expected 2\n", pDispParams
->cArgs
);
605 /* TODO: Check args */
608 case DISPID_DOWNLOADCOMPLETE
:
609 CHECK_EXPECT(Invoke_DOWNLOADCOMPLETE
);
611 ok(pDispParams
->rgvarg
== NULL
, "rgvarg=%p, expected NULL\n", pDispParams
->rgvarg
);
612 ok(pDispParams
->cArgs
== 0, "cArgs=%d, expected 0\n", pDispParams
->cArgs
);
615 case DISPID_ONMENUBAR
:
616 CHECK_EXPECT(Invoke_ONMENUBAR
);
617 test_invoke_bool(pDispParams
, TRUE
);
620 case DISPID_ONADDRESSBAR
:
621 CHECK_EXPECT(Invoke_ONADDRESSBAR
);
622 test_invoke_bool(pDispParams
, TRUE
);
625 case DISPID_ONSTATUSBAR
:
626 CHECK_EXPECT(Invoke_ONSTATUSBAR
);
627 test_invoke_bool(pDispParams
, TRUE
);
630 case DISPID_ONTOOLBAR
:
631 CHECK_EXPECT(Invoke_ONTOOLBAR
);
632 test_invoke_bool(pDispParams
, FALSE
);
635 case DISPID_ONFULLSCREEN
:
636 CHECK_EXPECT(Invoke_ONFULLSCREEN
);
637 test_invoke_bool(pDispParams
, TRUE
);
640 case DISPID_ONTHEATERMODE
:
641 CHECK_EXPECT(Invoke_ONTHEATERMODE
);
642 test_invoke_bool(pDispParams
, TRUE
);
645 case DISPID_WINDOWSETRESIZABLE
:
646 CHECK_EXPECT(Invoke_WINDOWSETRESIZABLE
);
647 test_invoke_bool(pDispParams
, TRUE
);
651 ok(0, "unexpected dispIdMember %d\n", dispIdMember
);
657 static IDispatchVtbl WebBrowserEvents2Vtbl
= {
658 WebBrowserEvents2_QueryInterface
,
661 Dispatch_GetTypeInfoCount
,
662 Dispatch_GetTypeInfo
,
663 Dispatch_GetIDsOfNames
,
664 WebBrowserEvents2_Invoke
667 static IDispatch WebBrowserEvents2
= { &WebBrowserEvents2Vtbl
};
669 static HRESULT WINAPI
ClientSite_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppv
)
671 return QueryInterface(riid
, ppv
);
674 static ULONG WINAPI
ClientSite_AddRef(IOleClientSite
*iface
)
679 static ULONG WINAPI
ClientSite_Release(IOleClientSite
*iface
)
684 static HRESULT WINAPI
ClientSite_SaveObject(IOleClientSite
*iface
)
686 ok(0, "unexpected call\n");
690 static HRESULT WINAPI
ClientSite_GetMoniker(IOleClientSite
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
,
693 ok(0, "unexpected call\n");
697 static HRESULT WINAPI
ClientSite_GetContainer(IOleClientSite
*iface
, IOleContainer
**ppContainer
)
699 CHECK_EXPECT(GetContainer
);
701 ok(ppContainer
!= NULL
, "ppContainer == NULL\n");
703 *ppContainer
= &OleContainer
;
708 static HRESULT WINAPI
ClientSite_ShowObject(IOleClientSite
*iface
)
710 CHECK_EXPECT(ShowObject
);
714 static HRESULT WINAPI
ClientSite_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
716 ok(0, "unexpected call\n");
720 static HRESULT WINAPI
ClientSite_RequestNewObjectLayout(IOleClientSite
*iface
)
722 ok(0, "unexpected call\n");
726 static const IOleClientSiteVtbl ClientSiteVtbl
= {
727 ClientSite_QueryInterface
,
730 ClientSite_SaveObject
,
731 ClientSite_GetMoniker
,
732 ClientSite_GetContainer
,
733 ClientSite_ShowObject
,
734 ClientSite_OnShowWindow
,
735 ClientSite_RequestNewObjectLayout
738 static IOleClientSite ClientSite
= { &ClientSiteVtbl
};
740 static HRESULT WINAPI
InPlaceUIWindow_QueryInterface(IOleInPlaceFrame
*iface
,
741 REFIID riid
, void **ppv
)
743 ok(0, "unexpected call\n");
744 return E_NOINTERFACE
;
747 static ULONG WINAPI
InPlaceUIWindow_AddRef(IOleInPlaceFrame
*iface
)
752 static ULONG WINAPI
InPlaceUIWindow_Release(IOleInPlaceFrame
*iface
)
757 static HRESULT WINAPI
InPlaceUIWindow_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
759 ok(0, "unexpected call\n");
763 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
765 CHECK_EXPECT(Frame_GetWindow
);
766 ok(phwnd
!= NULL
, "phwnd == NULL\n");
768 *phwnd
= container_hwnd
;
772 static HRESULT WINAPI
InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
774 ok(0, "unexpected call\n");
778 static HRESULT WINAPI
InPlaceUIWindow_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
780 ok(0, "unexpected call\n");
784 static HRESULT WINAPI
InPlaceUIWindow_RequestBorderSpace(IOleInPlaceFrame
*iface
,
785 LPCBORDERWIDTHS pborderwidths
)
787 ok(0, "unexpected call\n");
791 static HRESULT WINAPI
InPlaceUIWindow_SetBorderSpace(IOleInPlaceFrame
*iface
,
792 LPCBORDERWIDTHS pborderwidths
)
794 ok(0, "unexpected call\n");
798 static HRESULT WINAPI
InPlaceUIWindow_SetActiveObject(IOleInPlaceFrame
*iface
,
799 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
801 CHECK_EXPECT(UIWindow_SetActiveObject
);
802 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
803 ok(!lstrcmpW(pszObjName
, wszItem
), "unexpected pszObjName\n");
807 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
808 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
810 CHECK_EXPECT(Frame_SetActiveObject
);
811 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
812 ok(!lstrcmpW(pszObjName
, wszItem
), "unexpected pszObjName\n");
816 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
817 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
819 ok(0, "unexpected call\n");
823 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
824 HOLEMENU holemenu
, HWND hwndActiveObject
)
826 CHECK_EXPECT(SetMenu
);
827 ok(hmenuShared
== NULL
, "hmenuShared=%p\n", hmenuShared
);
828 ok(holemenu
== NULL
, "holemenu=%p\n", holemenu
);
829 ok(hwndActiveObject
== shell_embedding_hwnd
, "hwndActiveObject=%p, expected %p\n",
830 hwndActiveObject
, shell_embedding_hwnd
);
834 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
836 ok(0, "unexpected call\n");
840 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
842 CHECK_EXPECT2(SetStatusText
);
843 /* FIXME: Check pszStatusText */
847 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
850 CHECK_EXPECT(EnableModeless_TRUE
);
852 CHECK_EXPECT(EnableModeless_FALSE
);
856 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
858 ok(0, "unexpected call\n");
862 static const IOleInPlaceFrameVtbl InPlaceUIWindowVtbl
= {
863 InPlaceUIWindow_QueryInterface
,
864 InPlaceUIWindow_AddRef
,
865 InPlaceUIWindow_Release
,
866 InPlaceUIWindow_GetWindow
,
867 InPlaceUIWindow_ContextSensitiveHelp
,
868 InPlaceUIWindow_GetBorder
,
869 InPlaceUIWindow_RequestBorderSpace
,
870 InPlaceUIWindow_SetBorderSpace
,
871 InPlaceUIWindow_SetActiveObject
,
874 static IOleInPlaceUIWindow InPlaceUIWindow
= { (IOleInPlaceUIWindowVtbl
*)&InPlaceUIWindowVtbl
};
876 static const IOleInPlaceFrameVtbl InPlaceFrameVtbl
= {
877 InPlaceUIWindow_QueryInterface
,
878 InPlaceUIWindow_AddRef
,
879 InPlaceUIWindow_Release
,
880 InPlaceFrame_GetWindow
,
881 InPlaceUIWindow_ContextSensitiveHelp
,
882 InPlaceUIWindow_GetBorder
,
883 InPlaceUIWindow_RequestBorderSpace
,
884 InPlaceUIWindow_SetBorderSpace
,
885 InPlaceFrame_SetActiveObject
,
886 InPlaceFrame_InsertMenus
,
887 InPlaceFrame_SetMenu
,
888 InPlaceFrame_RemoveMenus
,
889 InPlaceFrame_SetStatusText
,
890 InPlaceFrame_EnableModeless
,
891 InPlaceFrame_TranslateAccelerator
894 static IOleInPlaceFrame InPlaceFrame
= { &InPlaceFrameVtbl
};
896 static HRESULT WINAPI
InPlaceSite_QueryInterface(IOleInPlaceSiteEx
*iface
, REFIID riid
, void **ppv
)
898 return QueryInterface(riid
, ppv
);
901 static ULONG WINAPI
InPlaceSite_AddRef(IOleInPlaceSiteEx
*iface
)
906 static ULONG WINAPI
InPlaceSite_Release(IOleInPlaceSiteEx
*iface
)
911 static HRESULT WINAPI
InPlaceSite_GetWindow(IOleInPlaceSiteEx
*iface
, HWND
*phwnd
)
913 CHECK_EXPECT(Site_GetWindow
);
914 ok(phwnd
!= NULL
, "phwnd == NULL\n");
916 *phwnd
= container_hwnd
;
920 static HRESULT WINAPI
InPlaceSite_ContextSensitiveHelp(IOleInPlaceSiteEx
*iface
, BOOL fEnterMode
)
922 ok(0, "unexpected call\n");
926 static HRESULT WINAPI
InPlaceSite_CanInPlaceActivate(IOleInPlaceSiteEx
*iface
)
928 CHECK_EXPECT(CanInPlaceActivate
);
932 static HRESULT WINAPI
InPlaceSite_OnInPlaceActivate(IOleInPlaceSiteEx
*iface
)
934 CHECK_EXPECT(OnInPlaceActivate
);
938 static HRESULT WINAPI
InPlaceSite_OnUIActivate(IOleInPlaceSiteEx
*iface
)
940 CHECK_EXPECT(OnUIActivate
);
944 static HRESULT WINAPI
InPlaceSite_GetWindowContext(IOleInPlaceSiteEx
*iface
,
945 IOleInPlaceFrame
**ppFrame
, IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
946 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
948 static const RECT pos_rect
= {2,1,1002,901};
949 static const RECT clip_rect
= {10,10,990,890};
951 CHECK_EXPECT(GetWindowContext
);
953 ok(ppFrame
!= NULL
, "ppFrame = NULL\n");
955 *ppFrame
= &InPlaceFrame
;
957 ok(ppDoc
!= NULL
, "ppDoc = NULL\n");
959 *ppDoc
= &InPlaceUIWindow
;
961 ok(lprcPosRect
!= NULL
, "lprcPosRect = NULL\n");
963 memcpy(lprcPosRect
, &pos_rect
, sizeof(RECT
));
965 ok(lprcClipRect
!= NULL
, "lprcClipRect = NULL\n");
967 memcpy(lprcClipRect
, &clip_rect
, sizeof(RECT
));
969 ok(lpFrameInfo
!= NULL
, "lpFrameInfo = NULL\n");
971 lpFrameInfo
->cb
= sizeof(*lpFrameInfo
);
972 lpFrameInfo
->fMDIApp
= FALSE
;
973 lpFrameInfo
->hwndFrame
= container_hwnd
;
974 lpFrameInfo
->haccel
= NULL
;
975 lpFrameInfo
->cAccelEntries
= 0;
981 static HRESULT WINAPI
InPlaceSite_Scroll(IOleInPlaceSiteEx
*iface
, SIZE scrollExtant
)
983 ok(0, "unexpected call\n");
987 static HRESULT WINAPI
InPlaceSite_OnUIDeactivate(IOleInPlaceSiteEx
*iface
, BOOL fUndoable
)
989 ok(0, "unexpected call\n");
993 static HRESULT WINAPI
InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSiteEx
*iface
)
995 ok(0, "unexpected call\n");
999 static HRESULT WINAPI
InPlaceSite_DiscardUndoState(IOleInPlaceSiteEx
*iface
)
1001 ok(0, "unexpected call\n");
1005 static HRESULT WINAPI
InPlaceSite_DeactivateAndUndo(IOleInPlaceSiteEx
*iface
)
1007 ok(0, "unexpected call\n");
1011 static HRESULT WINAPI
InPlaceSite_OnPosRectChange(IOleInPlaceSiteEx
*iface
, LPCRECT lprcPosRect
)
1013 ok(0, "unexpected call\n");
1017 static HRESULT WINAPI
InPlaceSite_OnInPlaceActivateEx(IOleInPlaceSiteEx
*iface
,
1018 BOOL
*pNoRedraw
, DWORD dwFlags
)
1020 ok(0, "unexpected call\n");
1024 static HRESULT WINAPI
InPlaceSite_OnInPlaceDeactivateEx(IOleInPlaceSiteEx
*iface
,
1027 ok(0, "unexpected call\n");
1031 static HRESULT WINAPI
InPlaceSite_RequestUIActivate(IOleInPlaceSiteEx
*iface
)
1033 ok(0, "unexpected call\n");
1037 static const IOleInPlaceSiteExVtbl InPlaceSiteExVtbl
= {
1038 InPlaceSite_QueryInterface
,
1040 InPlaceSite_Release
,
1041 InPlaceSite_GetWindow
,
1042 InPlaceSite_ContextSensitiveHelp
,
1043 InPlaceSite_CanInPlaceActivate
,
1044 InPlaceSite_OnInPlaceActivate
,
1045 InPlaceSite_OnUIActivate
,
1046 InPlaceSite_GetWindowContext
,
1048 InPlaceSite_OnUIDeactivate
,
1049 InPlaceSite_OnInPlaceDeactivate
,
1050 InPlaceSite_DiscardUndoState
,
1051 InPlaceSite_DeactivateAndUndo
,
1052 InPlaceSite_OnPosRectChange
,
1053 InPlaceSite_OnInPlaceActivateEx
,
1054 InPlaceSite_OnInPlaceDeactivateEx
,
1055 InPlaceSite_RequestUIActivate
1058 static IOleInPlaceSiteEx InPlaceSite
= { &InPlaceSiteExVtbl
};
1060 static HRESULT WINAPI
DocHostUIHandler_QueryInterface(IDocHostUIHandler2
*iface
, REFIID riid
, void **ppv
)
1062 return QueryInterface(riid
, ppv
);
1065 static ULONG WINAPI
DocHostUIHandler_AddRef(IDocHostUIHandler2
*iface
)
1070 static ULONG WINAPI
DocHostUIHandler_Release(IDocHostUIHandler2
*iface
)
1075 static HRESULT WINAPI
DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2
*iface
, DWORD dwID
, POINT
*ppt
,
1076 IUnknown
*pcmdtReserved
, IDispatch
*pdicpReserved
)
1078 ok(0, "unexpected call %d %p %p %p\n", dwID
, ppt
, pcmdtReserved
, pdicpReserved
);
1082 static HRESULT WINAPI
DocHostUIHandler_GetHostInfo(IDocHostUIHandler2
*iface
, DOCHOSTUIINFO
*pInfo
)
1084 CHECK_EXPECT2(GetHostInfo
);
1085 ok(pInfo
!= NULL
, "pInfo=NULL\n");
1087 ok(pInfo
->cbSize
== sizeof(DOCHOSTUIINFO
) || broken(!pInfo
->cbSize
), "pInfo->cbSize=%u\n", pInfo
->cbSize
);
1088 ok(!pInfo
->dwFlags
, "pInfo->dwFlags=%08x, expected 0\n", pInfo
->dwFlags
);
1089 ok(!pInfo
->dwDoubleClick
, "pInfo->dwDoubleClick=%08x, expected 0\n", pInfo
->dwDoubleClick
);
1090 ok(!pInfo
->pchHostCss
, "pInfo->pchHostCss=%p, expected NULL\n", pInfo
->pchHostCss
);
1091 ok(!pInfo
->pchHostNS
, "pInfo->pchhostNS=%p, expected NULL\n", pInfo
->pchHostNS
);
1096 static HRESULT WINAPI
DocHostUIHandler_ShowUI(IDocHostUIHandler2
*iface
, DWORD dwID
,
1097 IOleInPlaceActiveObject
*pActiveObject
, IOleCommandTarget
*pCommandTarget
,
1098 IOleInPlaceFrame
*pFrame
, IOleInPlaceUIWindow
*pDoc
)
1100 ok(0, "unexpected call\n");
1104 static HRESULT WINAPI
DocHostUIHandler_HideUI(IDocHostUIHandler2
*iface
)
1106 ok(0, "unexpected call\n");
1110 static HRESULT WINAPI
DocHostUIHandler_UpdateUI(IDocHostUIHandler2
*iface
)
1112 CHECK_EXPECT(UpdateUI
);
1116 static HRESULT WINAPI
DocHostUIHandler_EnableModeless(IDocHostUIHandler2
*iface
, BOOL fEnable
)
1118 ok(0, "unexpected call\n");
1122 static HRESULT WINAPI
DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1124 ok(0, "unexpected call\n");
1128 static HRESULT WINAPI
DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1130 ok(0, "unexpected call\n");
1134 static HRESULT WINAPI
DocHostUIHandler_ResizeBorder(IDocHostUIHandler2
*iface
, LPCRECT prcBorder
,
1135 IOleInPlaceUIWindow
*pUIWindow
, BOOL fRameWindow
)
1137 ok(0, "unexpected call\n");
1141 static HRESULT WINAPI
DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2
*iface
, LPMSG lpMsg
,
1142 const GUID
*pguidCmdGroup
, DWORD nCmdID
)
1144 ok(0, "unexpected call\n");
1148 static HRESULT WINAPI
DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2
*iface
,
1149 LPOLESTR
*pchKey
, DWORD dw
)
1151 CHECK_EXPECT(GetOptionKeyPath
);
1152 ok(pchKey
!= NULL
, "pchKey==NULL\n");
1154 ok(*pchKey
== NULL
, "*pchKey=%p\n", *pchKey
);
1155 ok(!dw
, "dw=%x\n", dw
);
1159 static HRESULT WINAPI
DocHostUIHandler_GetDropTarget(IDocHostUIHandler2
*iface
,
1160 IDropTarget
*pDropTarget
, IDropTarget
**ppDropTarget
)
1162 ok(0, "unexpected call\n");
1166 static HRESULT WINAPI
DocHostUIHandler_GetExternal(IDocHostUIHandler2
*iface
, IDispatch
**ppDispatch
)
1168 ok(0, "unexpected call\n");
1172 static HRESULT WINAPI
DocHostUIHandler_TranslateUrl(IDocHostUIHandler2
*iface
, DWORD dwTranslate
,
1173 OLECHAR
*pchURLIn
, OLECHAR
**ppchURLOut
)
1175 ok(0, "unexpected call\n");
1179 static HRESULT WINAPI
DocHostUIHandler_FilterDataObject(IDocHostUIHandler2
*iface
, IDataObject
*pDO
,
1180 IDataObject
**ppPORet
)
1182 ok(0, "unexpected call\n");
1186 static HRESULT WINAPI
DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2
*iface
,
1187 LPOLESTR
*pchKey
, DWORD dw
)
1189 CHECK_EXPECT(GetOverridesKeyPath
);
1190 ok(pchKey
!= NULL
, "pchKey==NULL\n");
1192 ok(*pchKey
== NULL
, "*pchKey=%p\n", *pchKey
);
1193 ok(!dw
, "dw=%x\n", dw
);
1197 static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl
= {
1198 DocHostUIHandler_QueryInterface
,
1199 DocHostUIHandler_AddRef
,
1200 DocHostUIHandler_Release
,
1201 DocHostUIHandler_ShowContextMenu
,
1202 DocHostUIHandler_GetHostInfo
,
1203 DocHostUIHandler_ShowUI
,
1204 DocHostUIHandler_HideUI
,
1205 DocHostUIHandler_UpdateUI
,
1206 DocHostUIHandler_EnableModeless
,
1207 DocHostUIHandler_OnDocWindowActivate
,
1208 DocHostUIHandler_OnFrameWindowActivate
,
1209 DocHostUIHandler_ResizeBorder
,
1210 DocHostUIHandler_TranslateAccelerator
,
1211 DocHostUIHandler_GetOptionKeyPath
,
1212 DocHostUIHandler_GetDropTarget
,
1213 DocHostUIHandler_GetExternal
,
1214 DocHostUIHandler_TranslateUrl
,
1215 DocHostUIHandler_FilterDataObject
,
1216 DocHostUIHandler_GetOverrideKeyPath
1219 static IDocHostUIHandler2 DocHostUIHandler
= { &DocHostUIHandlerVtbl
};
1221 static HRESULT
QueryInterface(REFIID riid
, void **ppv
)
1225 if(IsEqualGUID(&IID_IUnknown
, riid
)
1226 || IsEqualGUID(&IID_IOleClientSite
, riid
))
1228 else if(IsEqualGUID(&IID_IOleWindow
, riid
)
1229 || IsEqualGUID(&IID_IOleInPlaceSite
, riid
)
1230 || IsEqualGUID(&IID_IOleInPlaceSiteEx
, riid
))
1231 *ppv
= &InPlaceSite
;
1232 else if(IsEqualGUID(&IID_IDocHostUIHandler
, riid
)
1233 || IsEqualGUID(&IID_IDocHostUIHandler2
, riid
))
1234 *ppv
= &DocHostUIHandler
;
1235 else if(IsEqualGUID(&IID_IDispatch
, riid
))
1241 return E_NOINTERFACE
;
1244 static LRESULT WINAPI
wnd_proc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
1246 return DefWindowProcW(hwnd
, msg
, wParam
, lParam
);
1249 static HWND
create_container_window(void)
1251 static const WCHAR wszWebBrowserContainer
[] =
1252 {'W','e','b','B','r','o','w','s','e','r','C','o','n','t','a','i','n','e','r',0};
1253 static WNDCLASSEXW wndclass
= {
1254 sizeof(WNDCLASSEXW
),
1257 0, 0, NULL
, NULL
, NULL
, NULL
, NULL
,
1258 wszWebBrowserContainer
,
1262 RegisterClassExW(&wndclass
);
1263 return CreateWindowW(wszWebBrowserContainer
, wszWebBrowserContainer
,
1264 WS_OVERLAPPEDWINDOW
, CW_USEDEFAULT
, CW_USEDEFAULT
, CW_USEDEFAULT
,
1265 CW_USEDEFAULT
, NULL
, NULL
, NULL
, NULL
);
1268 static void test_DoVerb(IUnknown
*unk
)
1271 RECT rect
= {0,0,1000,1000};
1274 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
1275 ok(hres
== S_OK
, "QueryInterface(IID_OleObject) failed: %08x\n", hres
);
1279 SET_EXPECT(CanInPlaceActivate
);
1280 SET_EXPECT(Site_GetWindow
);
1281 SET_EXPECT(OnInPlaceActivate
);
1282 SET_EXPECT(GetWindowContext
);
1283 SET_EXPECT(ShowObject
);
1284 SET_EXPECT(GetContainer
);
1285 SET_EXPECT(Frame_GetWindow
);
1286 SET_EXPECT(OnUIActivate
);
1287 SET_EXPECT(Frame_SetActiveObject
);
1288 SET_EXPECT(UIWindow_SetActiveObject
);
1289 SET_EXPECT(SetMenu
);
1291 hres
= IOleObject_DoVerb(oleobj
, OLEIVERB_SHOW
, NULL
, &ClientSite
,
1292 0, (HWND
)0xdeadbeef, &rect
);
1293 ok(hres
== S_OK
, "DoVerb failed: %08x\n", hres
);
1295 CHECK_CALLED(CanInPlaceActivate
);
1296 CHECK_CALLED(Site_GetWindow
);
1297 CHECK_CALLED(OnInPlaceActivate
);
1298 CHECK_CALLED(GetWindowContext
);
1299 CHECK_CALLED(ShowObject
);
1300 CHECK_CALLED(GetContainer
);
1301 CHECK_CALLED(Frame_GetWindow
);
1302 CHECK_CALLED(OnUIActivate
);
1303 CHECK_CALLED(Frame_SetActiveObject
);
1304 CHECK_CALLED(UIWindow_SetActiveObject
);
1305 CHECK_CALLED(SetMenu
);
1307 hres
= IOleObject_DoVerb(oleobj
, OLEIVERB_SHOW
, NULL
, &ClientSite
,
1308 0, (HWND
)0xdeadbeef, &rect
);
1309 ok(hres
== S_OK
, "DoVerb failed: %08x\n", hres
);
1311 IOleObject_Release(oleobj
);
1314 static void test_GetMiscStatus(IOleObject
*oleobj
)
1319 for(i
=0; i
<10; i
++) {
1321 hres
= IOleObject_GetMiscStatus(oleobj
, i
, &st
);
1322 ok(hres
== S_OK
, "GetMiscStatus failed: %08x\n", hres
);
1323 ok(st
== (OLEMISC_SETCLIENTSITEFIRST
|OLEMISC_ACTIVATEWHENVISIBLE
|OLEMISC_INSIDEOUT
1324 |OLEMISC_CANTLINKINSIDE
|OLEMISC_RECOMPOSEONRESIZE
),
1325 "st=%08x, expected OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|"
1326 "OLEMISC_INSIDEOUT|OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE)\n", st
);
1330 static void test_SetHostNames(IOleObject
*oleobj
)
1334 static const WCHAR test_appW
[] = {'t','e','s','t',' ','a','p','p',0};
1336 hres
= IOleObject_SetHostNames(oleobj
, test_appW
, (void*)0xdeadbeef);
1337 ok(hres
== S_OK
, "SetHostNames failed: %08x\n", hres
);
1340 static void test_ClientSite(IUnknown
*unk
, IOleClientSite
*client
)
1343 IOleInPlaceObject
*inplace
;
1347 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
1348 ok(hres
== S_OK
, "QueryInterface(IID_OleObject) failed: %08x\n", hres
);
1352 test_GetMiscStatus(oleobj
);
1353 test_SetHostNames(oleobj
);
1355 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceObject
, (void**)&inplace
);
1356 ok(hres
== S_OK
, "QueryInterface(IID_OleInPlaceObject) failed: %08x\n", hres
);
1358 IOleObject_Release(oleobj
);
1362 hres
= IOleInPlaceObject_GetWindow(inplace
, &hwnd
);
1363 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1364 ok((hwnd
== NULL
) ^ (client
== NULL
), "unexpected hwnd %p\n", hwnd
);
1367 SET_EXPECT(GetContainer
);
1368 SET_EXPECT(Site_GetWindow
);
1369 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1370 SET_EXPECT(Invoke_AMBIENT_SILENT
);
1372 SET_EXPECT(Invoke_DOWNLOADCOMPLETE
);
1373 SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
1374 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
1377 hres
= IOleObject_SetClientSite(oleobj
, client
);
1378 ok(hres
== S_OK
, "SetClientSite failed: %08x\n", hres
);
1381 CHECK_CALLED(GetContainer
);
1382 CHECK_CALLED(Site_GetWindow
);
1383 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1384 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
1386 todo_wine
CHECK_CALLED(Invoke_DOWNLOADCOMPLETE
);
1387 todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
1388 todo_wine
CHECK_CALLED(Invoke_COMMANDSTATECHANGE
);
1391 hres
= IOleInPlaceObject_GetWindow(inplace
, &hwnd
);
1392 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1393 ok((hwnd
== NULL
) == (client
== NULL
), "unexpected hwnd %p\n", hwnd
);
1395 shell_embedding_hwnd
= hwnd
;
1397 test_SetHostNames(oleobj
);
1399 IOleInPlaceObject_Release(inplace
);
1400 IOleObject_Release(oleobj
);
1403 static void test_ClassInfo(IUnknown
*unk
)
1405 IProvideClassInfo2
*class_info
;
1409 hres
= IUnknown_QueryInterface(unk
, &IID_IProvideClassInfo2
, (void**)&class_info
);
1410 ok(hres
== S_OK
, "QueryInterface(IID_IProvideClassInfo) failed: %08x\n", hres
);
1414 hres
= IProvideClassInfo2_GetGUID(class_info
, GUIDKIND_DEFAULT_SOURCE_DISP_IID
, &guid
);
1415 ok(hres
== S_OK
, "GetGUID failed: %08x\n", hres
);
1416 ok(IsEqualGUID(&DIID_DWebBrowserEvents2
, &guid
), "wrong guid\n");
1418 hres
= IProvideClassInfo2_GetGUID(class_info
, 0, &guid
);
1419 ok(hres
== E_FAIL
, "GetGUID failed: %08x, expected E_FAIL\n", hres
);
1420 ok(IsEqualGUID(&IID_NULL
, &guid
), "wrong guid\n");
1422 hres
= IProvideClassInfo2_GetGUID(class_info
, 2, &guid
);
1423 ok(hres
== E_FAIL
, "GetGUID failed: %08x, expected E_FAIL\n", hres
);
1424 ok(IsEqualGUID(&IID_NULL
, &guid
), "wrong guid\n");
1426 hres
= IProvideClassInfo2_GetGUID(class_info
, GUIDKIND_DEFAULT_SOURCE_DISP_IID
, NULL
);
1427 ok(hres
== E_POINTER
, "GetGUID failed: %08x, expected E_POINTER\n", hres
);
1429 hres
= IProvideClassInfo2_GetGUID(class_info
, 0, NULL
);
1430 ok(hres
== E_POINTER
, "GetGUID failed: %08x, expected E_POINTER\n", hres
);
1432 IProvideClassInfo2_Release(class_info
);
1435 static void test_ie_funcs(IUnknown
*unk
)
1444 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
1445 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
1452 hres
= IWebBrowser2_get_HWND(wb
, &hwnd
);
1453 ok(hres
== E_FAIL
, "get_HWND failed: %08x, expected E_FAIL\n", hres
);
1454 ok(hwnd
== 0, "unexpected hwnd %lx\n", hwnd
);
1458 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1459 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1460 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1462 SET_EXPECT(Invoke_ONMENUBAR
);
1463 hres
= IWebBrowser2_put_MenuBar(wb
, (exvb
= VARIANT_FALSE
));
1464 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1465 CHECK_CALLED(Invoke_ONMENUBAR
);
1467 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1468 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1469 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1471 SET_EXPECT(Invoke_ONMENUBAR
);
1472 hres
= IWebBrowser2_put_MenuBar(wb
, (exvb
= 100));
1473 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1474 CHECK_CALLED(Invoke_ONMENUBAR
);
1476 hres
= IWebBrowser2_get_MenuBar(wb
, &b
);
1477 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1478 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1482 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1483 ok(hres
== S_OK
, "get_AddressBar failed: %08x\n", hres
);
1484 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1486 SET_EXPECT(Invoke_ONADDRESSBAR
);
1487 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= VARIANT_FALSE
));
1488 ok(hres
== S_OK
, "put_AddressBar failed: %08x\n", hres
);
1489 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1491 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1492 ok(hres
== S_OK
, "get_MenuBar failed: %08x\n", hres
);
1493 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1495 SET_EXPECT(Invoke_ONADDRESSBAR
);
1496 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= 100));
1497 ok(hres
== S_OK
, "put_AddressBar failed: %08x\n", hres
);
1498 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1500 hres
= IWebBrowser2_get_AddressBar(wb
, &b
);
1501 ok(hres
== S_OK
, "get_AddressBar failed: %08x\n", hres
);
1502 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1504 SET_EXPECT(Invoke_ONADDRESSBAR
);
1505 hres
= IWebBrowser2_put_AddressBar(wb
, (exvb
= VARIANT_TRUE
));
1506 ok(hres
== S_OK
, "put_MenuBar failed: %08x\n", hres
);
1507 CHECK_CALLED(Invoke_ONADDRESSBAR
);
1511 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1512 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1513 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1515 SET_EXPECT(Invoke_ONSTATUSBAR
);
1516 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= VARIANT_TRUE
));
1517 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1518 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1520 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1521 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1522 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1524 SET_EXPECT(Invoke_ONSTATUSBAR
);
1525 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= VARIANT_FALSE
));
1526 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1527 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1529 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1530 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1531 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1533 SET_EXPECT(Invoke_ONSTATUSBAR
);
1534 hres
= IWebBrowser2_put_StatusBar(wb
, (exvb
= 100));
1535 ok(hres
== S_OK
, "put_StatusBar failed: %08x\n", hres
);
1536 CHECK_CALLED(Invoke_ONSTATUSBAR
);
1538 hres
= IWebBrowser2_get_StatusBar(wb
, &b
);
1539 ok(hres
== S_OK
, "get_StatusBar failed: %08x\n", hres
);
1540 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1544 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
1545 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
1548 SET_EXPECT(Invoke_ONTOOLBAR
);
1549 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= VARIANT_FALSE
));
1550 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
1551 CHECK_CALLED(Invoke_ONTOOLBAR
);
1553 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
1554 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
1555 ok(i
== VARIANT_FALSE
, "b=%x\n", i
);
1557 SET_EXPECT(Invoke_ONTOOLBAR
);
1558 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= 100));
1559 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
1560 CHECK_CALLED(Invoke_ONTOOLBAR
);
1562 hres
= IWebBrowser2_get_ToolBar(wb
, &i
);
1563 ok(hres
== S_OK
, "get_ToolBar failed: %08x\n", hres
);
1566 SET_EXPECT(Invoke_ONTOOLBAR
);
1567 hres
= IWebBrowser2_put_ToolBar(wb
, (exvb
= VARIANT_TRUE
));
1568 ok(hres
== S_OK
, "put_ToolBar failed: %08x\n", hres
);
1569 CHECK_CALLED(Invoke_ONTOOLBAR
);
1573 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
1574 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
1575 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1577 SET_EXPECT(Invoke_ONFULLSCREEN
);
1578 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= VARIANT_TRUE
));
1579 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
1580 CHECK_CALLED(Invoke_ONFULLSCREEN
);
1582 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
1583 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
1584 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1586 SET_EXPECT(Invoke_ONFULLSCREEN
);
1587 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= 100));
1588 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
1589 CHECK_CALLED(Invoke_ONFULLSCREEN
);
1591 hres
= IWebBrowser2_get_FullScreen(wb
, &b
);
1592 ok(hres
== S_OK
, "get_FullScreen failed: %08x\n", hres
);
1593 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1595 SET_EXPECT(Invoke_ONFULLSCREEN
);
1596 hres
= IWebBrowser2_put_FullScreen(wb
, (exvb
= VARIANT_FALSE
));
1597 ok(hres
== S_OK
, "put_FullScreen failed: %08x\n", hres
);
1598 CHECK_CALLED(Invoke_ONFULLSCREEN
);
1602 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
1603 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
1604 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1606 SET_EXPECT(Invoke_ONTHEATERMODE
);
1607 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= VARIANT_TRUE
));
1608 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
1609 CHECK_CALLED(Invoke_ONTHEATERMODE
);
1611 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
1612 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
1613 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1615 SET_EXPECT(Invoke_ONTHEATERMODE
);
1616 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= 100));
1617 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
1618 CHECK_CALLED(Invoke_ONTHEATERMODE
);
1620 hres
= IWebBrowser2_get_TheaterMode(wb
, &b
);
1621 ok(hres
== S_OK
, "get_TheaterMode failed: %08x\n", hres
);
1622 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1624 SET_EXPECT(Invoke_ONTHEATERMODE
);
1625 hres
= IWebBrowser2_put_TheaterMode(wb
, (exvb
= VARIANT_FALSE
));
1626 ok(hres
== S_OK
, "put_TheaterMode failed: %08x\n", hres
);
1627 CHECK_CALLED(Invoke_ONTHEATERMODE
);
1632 hres
= IWebBrowser2_get_Resizable(wb
, &b
);
1633 ok(hres
== E_NOTIMPL
, "get_Resizable failed: %08x\n", hres
);
1634 ok(b
== 0x100, "b=%x\n", b
);
1636 SET_EXPECT(Invoke_WINDOWSETRESIZABLE
);
1637 hres
= IWebBrowser2_put_Resizable(wb
, (exvb
= VARIANT_TRUE
));
1638 ok(hres
== S_OK
|| broken(hres
== E_NOTIMPL
), "put_Resizable failed: %08x\n", hres
);
1639 CHECK_CALLED_BROKEN(Invoke_WINDOWSETRESIZABLE
);
1641 SET_EXPECT(Invoke_WINDOWSETRESIZABLE
);
1642 hres
= IWebBrowser2_put_Resizable(wb
, (exvb
= VARIANT_FALSE
));
1643 ok(hres
== S_OK
|| broken(hres
== E_NOTIMPL
), "put_Resizable failed: %08x\n", hres
);
1644 CHECK_CALLED_BROKEN(Invoke_WINDOWSETRESIZABLE
);
1646 hres
= IWebBrowser2_get_Resizable(wb
, &b
);
1647 ok(hres
== E_NOTIMPL
, "get_Resizable failed: %08x\n", hres
);
1648 ok(b
== 0x100, "b=%x\n", b
);
1653 hres
= IWebBrowser2_get_Application(wb
, &disp
);
1654 ok(hres
== S_OK
, "get_Application failed: %08x\n", hres
);
1655 ok(disp
== (void*)wb
, "disp=%p, expected %p\n", disp
, wb
);
1657 IDispatch_Release(disp
);
1659 hres
= IWebBrowser2_get_Application(wb
, NULL
);
1660 ok(hres
== E_POINTER
, "get_Application failed: %08x, expected E_POINTER\n", hres
);
1664 hres
= IWebBrowser2_Quit(wb
);
1665 ok(hres
== E_FAIL
, "Quit failed: %08x, expected E_FAIL\n", hres
);
1667 IWebBrowser2_Release(wb
);
1670 static void test_Silent(IWebBrowser2
*wb
, IOleControl
*control
, BOOL is_clientsite
)
1676 hres
= IWebBrowser2_get_Silent(wb
, &b
);
1677 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
1678 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1680 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_TRUE
);
1681 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
1684 hres
= IWebBrowser2_get_Silent(wb
, &b
);
1685 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
1686 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1688 hres
= IWebBrowser2_put_Silent(wb
, 100);
1689 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
1692 hres
= IWebBrowser2_get_Silent(wb
, &b
);
1693 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
1694 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1696 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_FALSE
);
1697 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
1700 hres
= IWebBrowser2_get_Silent(wb
, &b
);
1701 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
1702 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1705 hres
= IWebBrowser2_put_Silent(wb
, VARIANT_TRUE
);
1706 ok(hres
== S_OK
, "set_Silent failed: %08x\n", hres
);
1708 SET_EXPECT(Invoke_AMBIENT_SILENT
);
1711 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_SILENT
);
1712 ok(hres
== S_OK
, "OnAmbientPropertyChange failed %08x\n", hres
);
1715 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
1718 hres
= IWebBrowser2_get_Silent(wb
, &b
);
1719 ok(hres
== S_OK
, "get_Silent failed: %08x\n", hres
);
1720 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1723 static void test_Offline(IWebBrowser2
*wb
, IOleControl
*control
, BOOL is_clientsite
)
1729 hres
= IWebBrowser2_get_Offline(wb
, &b
);
1730 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
1731 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1733 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_TRUE
);
1734 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
1737 hres
= IWebBrowser2_get_Offline(wb
, &b
);
1738 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
1739 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1741 hres
= IWebBrowser2_put_Offline(wb
, 100);
1742 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
1745 hres
= IWebBrowser2_get_Offline(wb
, &b
);
1746 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
1747 ok(b
== VARIANT_TRUE
, "b=%x\n", b
);
1749 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_FALSE
);
1750 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
1753 hres
= IWebBrowser2_get_Offline(wb
, &b
);
1754 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
1755 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1758 hres
= IWebBrowser2_put_Offline(wb
, VARIANT_TRUE
);
1759 ok(hres
== S_OK
, "set_Offline failed: %08x\n", hres
);
1761 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1764 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
);
1765 ok(hres
== S_OK
, "OnAmbientPropertyChange failed %08x\n", hres
);
1768 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1771 hres
= IWebBrowser2_get_Offline(wb
, &b
);
1772 ok(hres
== S_OK
, "get_Offline failed: %08x\n", hres
);
1773 ok(b
== VARIANT_FALSE
, "b=%x\n", b
);
1776 static void test_wb_funcs(IUnknown
*unk
, BOOL is_clientsite
)
1779 IOleControl
*control
;
1782 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
1783 ok(hres
== S_OK
, "Could not get IWebBrowser2 interface: %08x\n", hres
);
1785 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
1786 ok(hres
== S_OK
, "Could not get IOleControl interface: %08x\n", hres
);
1788 test_Silent(wb
, control
, is_clientsite
);
1789 test_Offline(wb
, control
, is_clientsite
);
1791 IWebBrowser_Release(wb
);
1792 IOleControl_Release(control
);
1795 static void test_GetControlInfo(IUnknown
*unk
)
1797 IOleControl
*control
;
1801 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
1802 ok(hres
== S_OK
, "Could not get IOleControl: %08x\n", hres
);
1806 hres
= IOleControl_GetControlInfo(control
, &info
);
1807 ok(hres
== E_NOTIMPL
, "GetControlInfo failed: %08x, exxpected E_NOTIMPL\n", hres
);
1808 hres
= IOleControl_GetControlInfo(control
, NULL
);
1809 ok(hres
== E_NOTIMPL
, "GetControlInfo failed: %08x, exxpected E_NOTIMPL\n", hres
);
1811 IOleControl_Release(control
);
1814 static void test_Extent(IUnknown
*unk
)
1817 SIZE size
, expected
;
1823 /* default aspect ratio is 96dpi / 96dpi */
1825 dpi_x
= GetDeviceCaps(hdc
, LOGPIXELSX
);
1826 dpi_y
= GetDeviceCaps(hdc
, LOGPIXELSY
);
1828 if (dpi_x
!= 96 || dpi_y
!= 96)
1829 trace("dpi: %d / %d\n", dpi_y
, dpi_y
);
1831 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
1832 ok(hres
== S_OK
, "Could not get IOleObkect: %08x\n", hres
);
1836 size
.cx
= size
.cy
= 0xdeadbeef;
1837 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
1838 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1839 /* Default size is 50x20 pixels, in himetric units */
1840 expected
.cx
= MulDiv( 50, 2540, dpi_x
);
1841 expected
.cy
= MulDiv( 20, 2540, dpi_y
);
1842 ok(size
.cx
== expected
.cx
&& size
.cy
== expected
.cy
, "size = {%d %d} (expected %d %d)\n",
1843 size
.cx
, size
.cy
, expected
.cx
, expected
.cy
);
1847 hres
= IOleObject_SetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
1848 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
1850 size
.cx
= size
.cy
= 0xdeadbeef;
1851 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
1852 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1853 ok(size
.cx
== 800 && size
.cy
== 700, "size = {%d %d}\n", size
.cx
, size
.cy
);
1855 size
.cx
= size
.cy
= 0xdeadbeef;
1856 hres
= IOleObject_GetExtent(oleobj
, 0, &size
);
1857 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1858 ok(size
.cx
== 800 && size
.cy
== 700, "size = {%d %d}\n", size
.cx
, size
.cy
);
1862 hres
= IOleObject_SetExtent(oleobj
, 0, &size
);
1863 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
1865 size
.cx
= size
.cy
= 0xdeadbeef;
1866 hres
= IOleObject_GetExtent(oleobj
, 0, &size
);
1867 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1868 ok(size
.cx
== 900 && size
.cy
== 800, "size = {%d %d}\n", size
.cx
, size
.cy
);
1870 size
.cx
= size
.cy
= 0xdeadbeef;
1871 hres
= IOleObject_GetExtent(oleobj
, 0xdeadbeef, &size
);
1872 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1873 ok(size
.cx
== 900 && size
.cy
== 800, "size = {%d %d}\n", size
.cx
, size
.cy
);
1877 hres
= IOleObject_SetExtent(oleobj
, 0xdeadbeef, &size
);
1878 ok(hres
== S_OK
, "SetExtent failed: %08x\n", hres
);
1880 size
.cx
= size
.cy
= 0xdeadbeef;
1881 hres
= IOleObject_GetExtent(oleobj
, 0xdeadbeef, &size
);
1882 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1883 ok(size
.cx
== 1000 && size
.cy
== 900, "size = {%d %d}\n", size
.cx
, size
.cy
);
1885 size
.cx
= size
.cy
= 0xdeadbeef;
1886 hres
= IOleObject_GetExtent(oleobj
, DVASPECT_CONTENT
, &size
);
1887 ok(hres
== S_OK
, "GetExtent failed: %08x\n", hres
);
1888 ok(size
.cx
== 1000 && size
.cy
== 900, "size = {%d %d}\n", size
.cx
, size
.cy
);
1890 IOleObject_Release(oleobj
);
1893 static void test_ConnectionPoint(IUnknown
*unk
, BOOL init
)
1895 IConnectionPointContainer
*container
;
1896 IConnectionPoint
*point
;
1899 static DWORD dw
= 100;
1901 hres
= IUnknown_QueryInterface(unk
, &IID_IConnectionPointContainer
, (void**)&container
);
1902 ok(hres
== S_OK
, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres
);
1906 hres
= IConnectionPointContainer_FindConnectionPoint(container
, &DIID_DWebBrowserEvents2
, &point
);
1907 IConnectionPointContainer_Release(container
);
1908 ok(hres
== S_OK
, "FindConnectionPoint failed: %08x\n", hres
);
1913 hres
= IConnectionPoint_Advise(point
, (IUnknown
*)&WebBrowserEvents2
, &dw
);
1914 ok(hres
== S_OK
, "Advise failed: %08x\n", hres
);
1915 ok(dw
== 1, "dw=%d, expected 1\n", dw
);
1917 hres
= IConnectionPoint_Unadvise(point
, dw
);
1918 ok(hres
== S_OK
, "Unadvise failed: %08x\n", hres
);
1921 IConnectionPoint_Release(point
);
1924 static void test_Navigate2(IUnknown
*unk
)
1926 IWebBrowser2
*webbrowser
;
1930 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&webbrowser
);
1931 ok(hres
== S_OK
, "QueryInterface(IID_IWebBrowser) failed: %08x\n", hres
);
1935 test_LocationURL(unk
, emptyW
);
1937 V_VT(&url
) = VT_BSTR
;
1938 V_BSTR(&url
) = SysAllocString(about_blankW
);
1940 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
1941 SET_EXPECT(Invoke_PROPERTYCHANGE
);
1942 SET_EXPECT(Invoke_BEFORENAVIGATE2
);
1943 SET_EXPECT(Invoke_DOWNLOADBEGIN
);
1944 SET_EXPECT(Exec_SETDOWNLOADSTATE_1
);
1945 SET_EXPECT(EnableModeless_FALSE
);
1946 SET_EXPECT(Invoke_STATUSTEXTCHANGE
);
1947 SET_EXPECT(SetStatusText
);
1948 SET_EXPECT(GetHostInfo
);
1949 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
1950 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
1951 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
1952 SET_EXPECT(GetOptionKeyPath
);
1953 SET_EXPECT(GetOverridesKeyPath
);
1954 SET_EXPECT(QueryStatus_SETPROGRESSTEXT
);
1955 SET_EXPECT(Exec_SETPROGRESSMAX
);
1956 SET_EXPECT(Exec_SETPROGRESSPOS
);
1957 SET_EXPECT(Invoke_SETSECURELOCKICON
);
1958 SET_EXPECT(Invoke_FILEDOWNLOAD
);
1959 SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
1960 SET_EXPECT(Invoke_COMMANDSTATECHANGE
);
1961 SET_EXPECT(EnableModeless_TRUE
);
1963 hres
= IWebBrowser2_Navigate2(webbrowser
, &url
, NULL
, NULL
, NULL
, NULL
);
1964 ok(hres
== S_OK
, "Navigate2 failed: %08x\n", hres
);
1966 CHECK_CALLED(Invoke_AMBIENT_USERMODE
);
1967 todo_wine
CHECK_CALLED(Invoke_PROPERTYCHANGE
);
1968 CHECK_CALLED(Invoke_BEFORENAVIGATE2
);
1969 todo_wine
CHECK_CALLED(Invoke_DOWNLOADBEGIN
);
1970 todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_1
);
1971 CHECK_CALLED(EnableModeless_FALSE
);
1972 CHECK_CALLED(Invoke_STATUSTEXTCHANGE
);
1973 CHECK_CALLED(SetStatusText
);
1974 CHECK_CALLED(GetHostInfo
);
1975 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
1976 CHECK_CALLED(Invoke_AMBIENT_USERAGENT
);
1977 CHECK_CALLED(Invoke_AMBIENT_PALETTE
);
1978 CHECK_CALLED(GetOptionKeyPath
);
1979 CHECK_CALLED_BROKEN(GetOverridesKeyPath
);
1980 todo_wine
CHECK_CALLED(QueryStatus_SETPROGRESSTEXT
);
1981 todo_wine
CHECK_CALLED(Exec_SETPROGRESSMAX
);
1982 todo_wine
CHECK_CALLED(Exec_SETPROGRESSPOS
);
1983 todo_wine
CHECK_CALLED_BROKEN(Invoke_SETSECURELOCKICON
);
1984 todo_wine
CHECK_CALLED_BROKEN(Invoke_FILEDOWNLOAD
);
1985 todo_wine
CHECK_CALLED(Invoke_COMMANDSTATECHANGE
);
1986 todo_wine
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
1987 CHECK_CALLED(EnableModeless_TRUE
);
1990 IWebBrowser2_Release(webbrowser
);
1993 static void test_IServiceProvider(IUnknown
*unk
)
1995 IServiceProvider
*servprov
= (void*)0xdeadbeef;
1997 IUnknown
*ret
= NULL
;
1998 static const IID IID_IBrowserService2
=
1999 {0x68BD21CC,0x438B,0x11d2,{0xA5,0x60,0x00,0xA0,0xC,0x2D,0xBF,0xE8}};
2001 hres
= IUnknown_QueryInterface(unk
, &IID_IServiceProvider
, (void**)&servprov
);
2002 ok(hres
== S_OK
, "QueryInterface returned %08x, expected S_OK\n", hres
);
2006 hres
= IServiceProvider_QueryService(servprov
, &SID_STopLevelBrowser
, &IID_IBrowserService2
, (LPVOID
*)&ret
);
2007 ok(hres
== E_FAIL
, "QueryService returned %08x, expected E_FAIL\n", hres
);
2008 ok(ret
== NULL
, "ret returned %p, expected NULL\n", ret
);
2011 IUnknown_Release(ret
);
2014 IServiceProvider_Release(servprov
);
2017 static void test_QueryInterface(IUnknown
*unk
)
2019 IQuickActivate
*qa
= (IQuickActivate
*)0xdeadbeef;
2020 IRunnableObject
*runnable
= (IRunnableObject
*)0xdeadbeef;
2021 IPerPropertyBrowsing
*propbrowse
= (void*)0xdeadbeef;
2022 IOleInPlaceSite
*inplace
= (void*)0xdeadbeef;
2023 IOleCache
*cache
= (void*)0xdeadbeef;
2024 IObjectWithSite
*site
= (void*)0xdeadbeef;
2025 IViewObjectEx
*viewex
= (void*)0xdeadbeef;
2028 hres
= IUnknown_QueryInterface(unk
, &IID_IQuickActivate
, (void**)&qa
);
2029 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2030 ok(qa
== NULL
, "qa=%p, expected NULL\n", qa
);
2032 hres
= IUnknown_QueryInterface(unk
, &IID_IRunnableObject
, (void**)&runnable
);
2033 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2034 ok(runnable
== NULL
, "runnable=%p, expected NULL\n", runnable
);
2036 hres
= IUnknown_QueryInterface(unk
, &IID_IPerPropertyBrowsing
, (void**)&propbrowse
);
2037 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2038 ok(propbrowse
== NULL
, "propbrowse=%p, expected NULL\n", propbrowse
);
2040 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCache
, (void**)&cache
);
2041 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2042 ok(cache
== NULL
, "cache=%p, expected NULL\n", cache
);
2044 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceSite
, (void**)&inplace
);
2045 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2046 ok(inplace
== NULL
, "inplace=%p, expected NULL\n", inplace
);
2048 hres
= IUnknown_QueryInterface(unk
, &IID_IObjectWithSite
, (void**)&site
);
2049 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2050 ok(site
== NULL
, "site=%p, expected NULL\n", site
);
2052 hres
= IUnknown_QueryInterface(unk
, &IID_IViewObjectEx
, (void**)&viewex
);
2053 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
2054 ok(viewex
== NULL
, "viewex=%p, expected NULL\n", viewex
);
2058 static void test_WebBrowser(void)
2060 IUnknown
*unk
= NULL
;
2064 hres
= CoCreateInstance(&CLSID_WebBrowser
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
2065 &IID_IUnknown
, (void**)&unk
);
2066 ok(hres
== S_OK
, "CoCreateInterface failed: %08x\n", hres
);
2070 hres
= IUnknown_QueryInterface(unk
, &IID_IWebBrowser2
, (void**)&wb
);
2071 ok(hres
== S_OK
, "Could not get IWebBrowser2 iface: %08x\n", hres
);
2073 test_QueryInterface(unk
);
2074 test_ClassInfo(unk
);
2075 test_LocationURL(unk
, emptyW
);
2076 test_ConnectionPoint(unk
, TRUE
);
2077 test_ClientSite(unk
, &ClientSite
);
2079 test_wb_funcs(unk
, TRUE
);
2081 test_Navigate2(unk
);
2082 test_ClientSite(unk
, NULL
);
2084 test_GetControlInfo(unk
);
2085 test_wb_funcs(unk
, FALSE
);
2086 test_ConnectionPoint(unk
, FALSE
);
2087 test_IServiceProvider(unk
);
2089 IWebBrowser2_Release(wb
);
2090 ref
= IUnknown_Release(unk
);
2091 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
2094 static void gecko_installer_workaround(BOOL disable
)
2099 static BOOL has_url
= FALSE
;
2100 static char url
[2048];
2102 if(!disable
&& !has_url
)
2105 res
= RegOpenKey(HKEY_CURRENT_USER
, "Software\\Wine\\MSHTML", &hkey
);
2106 if(res
!= ERROR_SUCCESS
)
2110 DWORD type
, size
= sizeof(url
);
2112 res
= RegQueryValueEx(hkey
, "GeckoUrl", NULL
, &type
, (PVOID
)url
, &size
);
2113 if(res
== ERROR_SUCCESS
&& type
== REG_SZ
)
2116 RegDeleteValue(hkey
, "GeckoUrl");
2118 RegSetValueEx(hkey
, "GeckoUrl", 0, REG_SZ
, (PVOID
)url
, lstrlenA(url
)+1);
2124 START_TEST(webbrowser
)
2126 gecko_installer_workaround(TRUE
);
2128 container_hwnd
= create_container_window();
2130 OleInitialize(NULL
);
2136 gecko_installer_workaround(FALSE
);