shdocvw: Ignore hwndParent in DoVerb.
[wine] / dlls / shdocvw / tests / webbrowser.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #define COBJMACROS
20 #define CONST_VTABLE
21
22 #include <wine/test.h>
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "ole2.h"
28 #include "exdisp.h"
29 #include "htiframe.h"
30 #include "mshtmhst.h"
31
32 #define DEFINE_EXPECT(func) \
33     static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
34
35 #define SET_EXPECT(func) \
36     expect_ ## func = TRUE
37
38 #define CHECK_EXPECT(func) \
39     do { \
40         ok(expect_ ##func, "unexpected call " #func "\n"); \
41         expect_ ## func = FALSE; \
42         called_ ## func = TRUE; \
43     }while(0)
44
45 #define CHECK_EXPECT2(func) \
46     do { \
47         ok(expect_ ##func, "unexpected call " #func "\n"); \
48         called_ ## func = TRUE; \
49     }while(0)
50
51 #define CHECK_CALLED(func) \
52     do { \
53         ok(called_ ## func, "expected " #func "\n"); \
54         expect_ ## func = called_ ## func = FALSE; \
55     }while(0)
56
57 DEFINE_EXPECT(GetContainer);
58 DEFINE_EXPECT(Site_GetWindow);
59 DEFINE_EXPECT(ShowObject);
60 DEFINE_EXPECT(CanInPlaceActivate);
61 DEFINE_EXPECT(OnInPlaceActivate);
62 DEFINE_EXPECT(OnUIActivate);
63 DEFINE_EXPECT(GetWindowContext);
64 DEFINE_EXPECT(Frame_GetWindow);
65 DEFINE_EXPECT(Frame_SetActiveObject);
66 DEFINE_EXPECT(UIWindow_SetActiveObject);
67 DEFINE_EXPECT(SetMenu);
68
69 static const WCHAR wszItem[] = {'i','t','e','m',0};
70
71 static HWND container_hwnd, shell_embedding_hwnd;
72
73 static HRESULT QueryInterface(REFIID,void**);
74
75 static HRESULT WINAPI OleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv)
76 {
77     if(IsEqualGUID(&IID_ITargetContainer, riid))
78         return E_NOINTERFACE; /* TODO */
79     if(IsEqualGUID(&IID_IOleCommandTarget, riid))
80         return E_NOINTERFACE; /* TODO */
81
82     ok(0, "unexpected call\n");
83     return E_NOINTERFACE;
84 }
85
86 static ULONG WINAPI OleContainer_AddRef(IOleContainer *iface)
87 {
88     return 2;
89 }
90
91 static ULONG WINAPI OleContainer_Release(IOleContainer *iface)
92 {
93     return 1;
94 }
95
96 static HRESULT WINAPI OleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc,
97         LPOLESTR pszDiaplayName, ULONG *pchEaten, IMoniker **ppmkOut)
98 {
99     ok(0, "unexpected call\n");
100     return E_NOTIMPL;
101 }
102
103 static HRESULT WINAPI OleContainer_EnumObjects(IOleContainer *iface, DWORD grfFlags,
104         IEnumUnknown **ppenum)
105 {
106     ok(0, "unexpected call\n");
107     return E_NOTIMPL;
108 }
109
110 static HRESULT WINAPI OleContainer_LockContainer(IOleContainer *iface, BOOL fLock)
111 {
112     ok(0, "unexpected call\n");
113     return E_NOTIMPL;
114 }
115
116 static const IOleContainerVtbl OleContainerVtbl = {
117     OleContainer_QueryInterface,
118     OleContainer_AddRef,
119     OleContainer_Release,
120     OleContainer_ParseDisplayName,
121     OleContainer_EnumObjects,
122     OleContainer_LockContainer
123 };
124
125 static IOleContainer OleContainer = { &OleContainerVtbl };
126
127 static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
128 {
129     return QueryInterface(riid, ppv);
130 }
131
132 static ULONG WINAPI ClientSite_AddRef(IOleClientSite *iface)
133 {
134     return 2;
135 }
136
137 static ULONG WINAPI ClientSite_Release(IOleClientSite *iface)
138 {
139     return 1;
140 }
141
142 static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
143 {
144     ok(0, "unexpected call\n");
145     return E_NOTIMPL;
146 }
147
148 static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAsign, DWORD dwWhichMoniker,
149         IMoniker **ppmon)
150 {
151     ok(0, "unexpected call\n");
152     return E_NOTIMPL;
153 }
154
155 static HRESULT WINAPI ClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
156 {
157     CHECK_EXPECT(GetContainer);
158
159     ok(ppContainer != NULL, "ppContainer == NULL\n");
160     if(ppContainer)
161         *ppContainer = &OleContainer;
162
163     return S_OK;
164 }
165
166 static HRESULT WINAPI ClientSite_ShowObject(IOleClientSite *iface)
167 {
168     CHECK_EXPECT(ShowObject);
169     return S_OK;
170 }
171
172 static HRESULT WINAPI ClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow)
173 {
174     ok(0, "unexpected call\n");
175     return E_NOTIMPL;
176 }
177
178 static HRESULT WINAPI ClientSite_RequestNewObjectLayout(IOleClientSite *iface)
179 {
180     ok(0, "unexpected call\n");
181     return E_NOTIMPL;
182 }
183
184 static const IOleClientSiteVtbl ClientSiteVtbl = {
185     ClientSite_QueryInterface,
186     ClientSite_AddRef,
187     ClientSite_Release,
188     ClientSite_SaveObject,
189     ClientSite_GetMoniker,
190     ClientSite_GetContainer,
191     ClientSite_ShowObject,
192     ClientSite_OnShowWindow,
193     ClientSite_RequestNewObjectLayout
194 };
195
196 static IOleClientSite ClientSite = { &ClientSiteVtbl };
197
198 static HRESULT WINAPI InPlaceUIWindow_QueryInterface(IOleInPlaceFrame *iface,
199                                                      REFIID riid, void **ppv)
200 {
201     ok(0, "unexpected call\n");
202     return E_NOINTERFACE;
203 }
204
205 static ULONG WINAPI InPlaceUIWindow_AddRef(IOleInPlaceFrame *iface)
206 {
207     return 2;
208 }
209
210 static ULONG WINAPI InPlaceUIWindow_Release(IOleInPlaceFrame *iface)
211 {
212     return 1;
213 }
214
215 static HRESULT WINAPI InPlaceUIWindow_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
216 {
217     ok(0, "unexpected call\n");
218     return E_NOTIMPL;
219 }
220
221 static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
222 {
223     CHECK_EXPECT(Frame_GetWindow);
224     ok(phwnd != NULL, "phwnd == NULL\n");
225     if(phwnd)
226         *phwnd = container_hwnd;
227     return S_OK;
228 }
229
230 static HRESULT WINAPI InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceFrame *iface, BOOL fEnterMode)
231 {
232     ok(0, "unexpected call\n");
233     return E_NOTIMPL;
234 }
235
236 static HRESULT WINAPI InPlaceUIWindow_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
237 {
238     ok(0, "unexpected call\n");
239     return E_NOTIMPL;
240 }
241
242 static HRESULT WINAPI InPlaceUIWindow_RequestBorderSpace(IOleInPlaceFrame *iface,
243         LPCBORDERWIDTHS pborderwidths)
244 {
245     ok(0, "unexpected call\n");
246     return E_NOTIMPL;
247 }
248
249 static HRESULT WINAPI InPlaceUIWindow_SetBorderSpace(IOleInPlaceFrame *iface,
250         LPCBORDERWIDTHS pborderwidths)
251 {
252     ok(0, "unexpected call\n");
253     return E_NOTIMPL;
254 }
255
256 static HRESULT WINAPI InPlaceUIWindow_SetActiveObject(IOleInPlaceFrame *iface,
257         IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
258 {
259     CHECK_EXPECT(UIWindow_SetActiveObject);
260     ok(pActiveObject != NULL, "pActiveObject = NULL\n");
261     ok(!lstrcmpW(pszObjName, wszItem), "unexpected pszObjName\n");
262     return S_OK;
263 }
264
265 static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
266         IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
267 {
268     CHECK_EXPECT(Frame_SetActiveObject);
269     ok(pActiveObject != NULL, "pActiveObject = NULL\n");
270     ok(!lstrcmpW(pszObjName, wszItem), "unexpected pszObjName\n");
271     return S_OK;
272 }
273
274 static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
275         LPOLEMENUGROUPWIDTHS lpMenuWidths)
276 {
277     ok(0, "unexpected call\n");
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
282         HOLEMENU holemenu, HWND hwndActiveObject)
283 {
284     CHECK_EXPECT(SetMenu);
285     ok(hmenuShared == NULL, "hmenuShared=%p\n", hmenuShared);
286     ok(holemenu == NULL, "holemenu=%p\n", holemenu);
287     ok(hwndActiveObject == shell_embedding_hwnd, "hwndActiveObject=%p, expected %p\n",
288        hwndActiveObject, shell_embedding_hwnd);
289     return S_OK;
290 }
291
292 static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
293 {
294     ok(0, "unexpected call\n");
295     return E_NOTIMPL;
296 }
297
298 static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
299 {
300     ok(0, "unexpected call\n");
301     return E_NOTIMPL;
302 }
303
304 static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
305 {
306     ok(0, "unexpected call\n");
307     return E_NOTIMPL;
308 }
309
310 static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID)
311 {
312     ok(0, "unexpected call\n");
313     return E_NOTIMPL;
314 }
315
316 static const IOleInPlaceFrameVtbl InPlaceUIWindowVtbl = {
317     InPlaceUIWindow_QueryInterface,
318     InPlaceUIWindow_AddRef,
319     InPlaceUIWindow_Release,
320     InPlaceUIWindow_GetWindow,
321     InPlaceUIWindow_ContextSensitiveHelp,
322     InPlaceUIWindow_GetBorder,
323     InPlaceUIWindow_RequestBorderSpace,
324     InPlaceUIWindow_SetBorderSpace,
325     InPlaceUIWindow_SetActiveObject,
326 };
327
328 static IOleInPlaceUIWindow InPlaceUIWindow = { (IOleInPlaceUIWindowVtbl*)&InPlaceUIWindowVtbl };
329
330 static const IOleInPlaceFrameVtbl InPlaceFrameVtbl = {
331     InPlaceUIWindow_QueryInterface,
332     InPlaceUIWindow_AddRef,
333     InPlaceUIWindow_Release,
334     InPlaceFrame_GetWindow,
335     InPlaceUIWindow_ContextSensitiveHelp,
336     InPlaceUIWindow_GetBorder,
337     InPlaceUIWindow_RequestBorderSpace,
338     InPlaceUIWindow_SetBorderSpace,
339     InPlaceFrame_SetActiveObject,
340     InPlaceFrame_InsertMenus,
341     InPlaceFrame_SetMenu,
342     InPlaceFrame_RemoveMenus,
343     InPlaceFrame_SetStatusText,
344     InPlaceFrame_EnableModeless,
345     InPlaceFrame_TranslateAccelerator
346 };
347
348 static IOleInPlaceFrame InPlaceFrame = { &InPlaceFrameVtbl };
349
350 static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSiteEx *iface, REFIID riid, void **ppv)
351 {
352     return QueryInterface(riid, ppv);
353 }
354
355 static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSiteEx *iface)
356 {
357     return 2;
358 }
359
360 static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSiteEx *iface)
361 {
362     return 1;
363 }
364
365 static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSiteEx *iface, HWND *phwnd)
366 {
367     CHECK_EXPECT(Site_GetWindow);
368     ok(phwnd != NULL, "phwnd == NULL\n");
369     if(phwnd)
370         *phwnd = container_hwnd;
371     return S_OK;
372 }
373
374 static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSiteEx *iface, BOOL fEnterMode)
375 {
376     ok(0, "unexpected call\n");
377     return E_NOTIMPL;
378 }
379
380 static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSiteEx *iface)
381 {
382     CHECK_EXPECT(CanInPlaceActivate);
383     return S_OK;
384 }
385
386 static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSiteEx *iface)
387 {
388     CHECK_EXPECT(OnInPlaceActivate);
389     return S_OK;
390 }
391
392 static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSiteEx *iface)
393 {
394     CHECK_EXPECT(OnUIActivate);
395     return S_OK;
396 }
397
398 static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSiteEx *iface,
399         IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
400         LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
401 {
402     static const RECT pos_rect = {2,1,1002,901};
403     static const RECT clip_rect = {10,10,990,890};
404
405     CHECK_EXPECT(GetWindowContext);
406
407     ok(ppFrame != NULL, "ppFrame = NULL\n");
408     if(ppFrame)
409         *ppFrame = &InPlaceFrame;
410
411     ok(ppDoc != NULL, "ppDoc = NULL\n");
412     if(ppDoc)
413         *ppDoc = &InPlaceUIWindow;
414
415     ok(lprcPosRect != NULL, "lprcPosRect = NULL\n");
416     if(lprcPosRect)
417         memcpy(lprcPosRect, &pos_rect, sizeof(RECT));
418
419     ok(lprcClipRect != NULL, "lprcClipRect = NULL\n");
420     if(lprcClipRect)
421         memcpy(lprcClipRect, &clip_rect, sizeof(RECT));
422
423     ok(lpFrameInfo != NULL, "lpFrameInfo = NULL\n");
424     if(lpFrameInfo) {
425         lpFrameInfo->cb = sizeof(*lpFrameInfo);
426         lpFrameInfo->fMDIApp = FALSE;
427         lpFrameInfo->hwndFrame = container_hwnd;
428         lpFrameInfo->haccel = NULL;
429         lpFrameInfo->cAccelEntries = 0;
430     }
431
432     return S_OK;
433 }
434
435 static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSiteEx *iface, SIZE scrollExtant)
436 {
437     ok(0, "unexpected call\n");
438     return E_NOTIMPL;
439 }
440
441 static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSiteEx *iface, BOOL fUndoable)
442 {
443     ok(0, "unexpected call\n");
444     return E_NOTIMPL;
445 }
446
447 static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSiteEx *iface)
448 {
449     ok(0, "unexpected call\n");
450     return E_NOTIMPL;
451 }
452
453 static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSiteEx *iface)
454 {
455     ok(0, "unexpected call\n");
456     return E_NOTIMPL;
457 }
458
459 static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSiteEx *iface)
460 {
461     ok(0, "unexpected call\n");
462     return E_NOTIMPL;
463 }
464
465 static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSiteEx *iface, LPCRECT lprcPosRect)
466 {
467     ok(0, "unexpected call\n");
468     return E_NOTIMPL;
469 }
470
471 static HRESULT WINAPI InPlaceSite_OnInPlaceActivateEx(IOleInPlaceSiteEx *iface,
472                                                       BOOL *pNoRedraw, DWORD dwFlags)
473 {
474     ok(0, "unexpected call\n");
475     return E_NOTIMPL;
476 }
477
478 static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivateEx(IOleInPlaceSiteEx *iface,
479                                                         BOOL fNoRedraw)
480 {
481     ok(0, "unexpected call\n");
482     return E_NOTIMPL;
483 }
484
485 static HRESULT WINAPI InPlaceSite_RequestUIActivate(IOleInPlaceSiteEx *iface)
486 {
487     ok(0, "unexpected call\n");
488     return S_OK;
489 }
490
491 static const IOleInPlaceSiteExVtbl InPlaceSiteExVtbl = {
492     InPlaceSite_QueryInterface,
493     InPlaceSite_AddRef,
494     InPlaceSite_Release,
495     InPlaceSite_GetWindow,
496     InPlaceSite_ContextSensitiveHelp,
497     InPlaceSite_CanInPlaceActivate,
498     InPlaceSite_OnInPlaceActivate,
499     InPlaceSite_OnUIActivate,
500     InPlaceSite_GetWindowContext,
501     InPlaceSite_Scroll,
502     InPlaceSite_OnUIDeactivate,
503     InPlaceSite_OnInPlaceDeactivate,
504     InPlaceSite_DiscardUndoState,
505     InPlaceSite_DeactivateAndUndo,
506     InPlaceSite_OnPosRectChange,
507     InPlaceSite_OnInPlaceActivateEx,
508     InPlaceSite_OnInPlaceDeactivateEx,
509     InPlaceSite_RequestUIActivate
510 };
511
512 static IOleInPlaceSiteEx InPlaceSite = { &InPlaceSiteExVtbl };
513
514 static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface, REFIID riid, void **ppv)
515 {
516     return QueryInterface(riid, ppv);
517 }
518
519 static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
520 {
521     return 2;
522 }
523
524 static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
525 {
526     return 1;
527 }
528
529 static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt,
530         IUnknown *pcmdtReserved, IDispatch *pdicpReserved)
531 {
532     ok(0, "unexpected call %d %p %p %p\n", dwID, ppt, pcmdtReserved, pdicpReserved);
533     return S_FALSE;
534 }
535
536 static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface, DOCHOSTUIINFO *pInfo)
537 {
538     ok(0, "unexpected call\n");
539     return E_NOTIMPL;
540 }
541
542 static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD dwID,
543         IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
544         IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
545 {
546     ok(0, "unexpected call\n");
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
551 {
552     ok(0, "unexpected call\n");
553     return E_NOTIMPL;
554 }
555
556 static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
557 {
558     ok(0, "unexpected call\n");
559     return E_NOTIMPL;
560 }
561
562 static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface, BOOL fEnable)
563 {
564     ok(0, "unexpected call\n");
565     return E_NOTIMPL;
566 }
567
568 static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
569 {
570     ok(0, "unexpected call\n");
571     return E_NOTIMPL;
572 }
573
574 static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface, BOOL fActivate)
575 {
576     ok(0, "unexpected call\n");
577     return E_NOTIMPL;
578 }
579
580 static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface, LPCRECT prcBorder,
581         IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
582 {
583     ok(0, "unexpected call\n");
584     return E_NOTIMPL;
585 }
586
587 static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface, LPMSG lpMsg,
588         const GUID *pguidCmdGroup, DWORD nCmdID)
589 {
590     ok(0, "unexpected call\n");
591     return E_NOTIMPL;
592 }
593
594 static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface,
595         LPOLESTR *pchKey, DWORD dw)
596 {
597     ok(0, "unexpected call\n");
598     return E_NOTIMPL;
599 }
600
601 static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
602         IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
603 {
604     ok(0, "unexpected call\n");
605     return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface, IDispatch **ppDispatch)
609 {
610     ok(0, "unexpected call\n");
611     return E_NOTIMPL;
612 }
613
614 static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, DWORD dwTranslate,
615         OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
616 {
617     ok(0, "unexpected call\n");
618     return E_NOTIMPL;
619 }
620
621 static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface, IDataObject *pDO,
622         IDataObject **ppPORet)
623 {
624     ok(0, "unexpected call\n");
625     return E_NOTIMPL;
626 }
627
628 static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface,
629         LPOLESTR *pchKey, DWORD dw)
630 {
631     ok(0, "unexpected call\n");
632     return E_NOTIMPL;
633 }
634
635 static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl = {
636     DocHostUIHandler_QueryInterface,
637     DocHostUIHandler_AddRef,
638     DocHostUIHandler_Release,
639     DocHostUIHandler_ShowContextMenu,
640     DocHostUIHandler_GetHostInfo,
641     DocHostUIHandler_ShowUI,
642     DocHostUIHandler_HideUI,
643     DocHostUIHandler_UpdateUI,
644     DocHostUIHandler_EnableModeless,
645     DocHostUIHandler_OnDocWindowActivate,
646     DocHostUIHandler_OnFrameWindowActivate,
647     DocHostUIHandler_ResizeBorder,
648     DocHostUIHandler_TranslateAccelerator,
649     DocHostUIHandler_GetOptionKeyPath,
650     DocHostUIHandler_GetDropTarget,
651     DocHostUIHandler_GetExternal,
652     DocHostUIHandler_TranslateUrl,
653     DocHostUIHandler_FilterDataObject,
654     DocHostUIHandler_GetOverrideKeyPath
655 };
656
657 static IDocHostUIHandler2 DocHostUIHandler = { &DocHostUIHandlerVtbl };
658
659 static HRESULT QueryInterface(REFIID riid, void **ppv)
660 {
661     *ppv = NULL;
662
663     if(IsEqualGUID(&IID_IUnknown, riid)
664             || IsEqualGUID(&IID_IOleClientSite, riid))
665         *ppv = &ClientSite;
666     else if(IsEqualGUID(&IID_IOleWindow, riid)
667             || IsEqualGUID(&IID_IOleInPlaceSite, riid)
668             || IsEqualGUID(&IID_IOleInPlaceSiteEx, riid))
669         *ppv = &InPlaceSite;
670     else if(IsEqualGUID(&IID_IDocHostUIHandler, riid)
671             || IsEqualGUID(&IID_IDocHostUIHandler2, riid))
672         *ppv = &DocHostUIHandler;
673
674     if(*ppv)
675         return S_OK;
676
677     return E_NOINTERFACE;
678 }
679
680 static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
681 {
682     return DefWindowProcW(hwnd, msg, wParam, lParam);
683 }
684
685 static HWND create_container_window(void)
686 {
687     static const WCHAR wszWebBrowserContainer[] =
688         {'W','e','b','B','r','o','w','s','e','r','C','o','n','t','a','i','n','e','r',0};
689     static WNDCLASSEXW wndclass = {
690         sizeof(WNDCLASSEXW),
691         0,
692         wnd_proc,
693         0, 0, NULL, NULL, NULL, NULL, NULL,
694         wszWebBrowserContainer,
695         NULL
696     };
697
698     RegisterClassExW(&wndclass);
699     return CreateWindowW(wszWebBrowserContainer, wszWebBrowserContainer,
700             WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
701             CW_USEDEFAULT, NULL, NULL, NULL, NULL);
702 }
703
704 static void test_DoVerb(IUnknown *unk)
705 {
706     IOleObject *oleobj;
707     RECT rect = {0,0,1000,1000};
708     HRESULT hres;
709
710     hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
711     ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres);
712     if(FAILED(hres))
713         return;
714
715     SET_EXPECT(CanInPlaceActivate);
716     SET_EXPECT(Site_GetWindow);
717     SET_EXPECT(OnInPlaceActivate);
718     SET_EXPECT(GetWindowContext);
719     SET_EXPECT(ShowObject);
720     SET_EXPECT(GetContainer);
721     SET_EXPECT(Frame_GetWindow);
722     SET_EXPECT(OnUIActivate);
723     SET_EXPECT(Frame_SetActiveObject);
724     SET_EXPECT(UIWindow_SetActiveObject);
725     SET_EXPECT(SetMenu);
726
727     hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite,
728                              0, (HWND)0xdeadbeef, &rect);
729     ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
730
731     CHECK_CALLED(CanInPlaceActivate);
732     CHECK_CALLED(Site_GetWindow);
733     CHECK_CALLED(OnInPlaceActivate);
734     CHECK_CALLED(GetWindowContext);
735     CHECK_CALLED(ShowObject);
736     CHECK_CALLED(GetContainer);
737     CHECK_CALLED(Frame_GetWindow);
738     CHECK_CALLED(OnUIActivate);
739     CHECK_CALLED(Frame_SetActiveObject);
740     CHECK_CALLED(UIWindow_SetActiveObject);
741     CHECK_CALLED(SetMenu);
742
743     hres = IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, &ClientSite,
744                            0, (HWND)0xdeadbeef, &rect);
745     ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
746
747     IOleObject_Release(oleobj);
748 }
749
750 static void test_GetMiscStatus(IOleObject *oleobj)
751 {
752     DWORD st, i;
753     HRESULT hres;
754
755     for(i=0; i<10; i++) {
756         st = 0xdeadbeef;
757         hres = IOleObject_GetMiscStatus(oleobj, i, &st);
758         ok(hres == S_OK, "GetMiscStatus failed: %08x\n", hres);
759         ok(st == (OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT
760                   |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE),
761            "st=%08x, expected OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|"
762            "OLEMISC_INSIDEOUT|OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE)\n", st);
763     }
764 }
765
766 static void test_ClientSite(IUnknown *unk, IOleClientSite *client)
767 {
768     IOleObject *oleobj;
769     IOleInPlaceObject *inplace;
770     HWND hwnd;
771     HRESULT hres;
772
773     hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
774     ok(hres == S_OK, "QueryInterface(IID_OleObject) failed: %08x\n", hres);
775     if(FAILED(hres))
776         return;
777
778     test_GetMiscStatus(oleobj);
779
780     hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceObject, (void**)&inplace);
781     ok(hres == S_OK, "QueryInterface(IID_OleInPlaceObject) failed: %08x\n", hres);
782     if(FAILED(hres)) {
783         IOleObject_Release(oleobj);
784         return;
785     }
786
787     hres = IOleInPlaceObject_GetWindow(inplace, &hwnd);
788     ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
789     ok((hwnd == NULL) ^ (client == NULL), "unexpected hwnd %p\n", hwnd);
790
791     if(client) {
792         SET_EXPECT(GetContainer);
793         SET_EXPECT(Site_GetWindow);
794     }
795
796     hres = IOleObject_SetClientSite(oleobj, client);
797     ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
798
799     if(client) {
800         CHECK_CALLED(GetContainer);
801         CHECK_CALLED(Site_GetWindow);
802     }
803
804     hres = IOleInPlaceObject_GetWindow(inplace, &hwnd);
805     ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
806     ok((hwnd == NULL) == (client == NULL), "unexpected hwnd %p\n", hwnd);
807
808     shell_embedding_hwnd = hwnd;
809
810     IOleInPlaceObject_Release(inplace);
811     IOleObject_Release(oleobj);
812 }
813
814 static void test_ClassInfo(IUnknown *unk)
815 {
816     IProvideClassInfo2 *class_info;
817     GUID guid;
818     HRESULT hres;
819
820     hres = IUnknown_QueryInterface(unk, &IID_IProvideClassInfo2, (void**)&class_info);
821     ok(hres == S_OK, "QueryInterface(IID_IProvideClassInfo)  failed: %08x\n", hres);
822     if(FAILED(hres))
823         return;
824
825     hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid);
826     ok(hres == S_OK, "GetGUID failed: %08x\n", hres);
827     ok(IsEqualGUID(&DIID_DWebBrowserEvents2, &guid), "wrong guid\n");
828
829     hres = IProvideClassInfo2_GetGUID(class_info, 0, &guid);
830     ok(hres == E_FAIL, "GetGUID failed: %08x, expected E_FAIL\n", hres);
831     ok(IsEqualGUID(&IID_NULL, &guid), "wrong guid\n");
832
833     hres = IProvideClassInfo2_GetGUID(class_info, 2, &guid);
834     ok(hres == E_FAIL, "GetGUID failed: %08x, expected E_FAIL\n", hres);
835     ok(IsEqualGUID(&IID_NULL, &guid), "wrong guid\n");
836
837     hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, NULL);
838     ok(hres == E_POINTER, "GetGUID failed: %08x, expected E_POINTER\n", hres);
839
840     hres = IProvideClassInfo2_GetGUID(class_info, 0, NULL);
841     ok(hres == E_POINTER, "GetGUID failed: %08x, expected E_POINTER\n", hres);
842
843     IProvideClassInfo2_Release(class_info);
844 }
845
846 static void test_ie_funcs(IUnknown *unk)
847 {
848     IWebBrowser2 *wb;
849     VARIANT_BOOL b;
850     int i;
851     long hwnd;
852     HRESULT hres;
853
854     hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
855     ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
856     if(FAILED(hres))
857         return;
858
859     /* HWND */
860
861     hwnd = 0xdeadbeef;
862     hres = IWebBrowser2_get_HWND(wb, &hwnd);
863     ok(hres == E_FAIL, "get_HWND failed: %08x, expected E_FAIL\n", hres);
864     ok(hwnd == 0, "unexpected hwnd %lx\n", hwnd);
865
866     /* MenuBar */
867
868     hres = IWebBrowser2_get_MenuBar(wb, &b);
869     ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres);
870     ok(b == VARIANT_TRUE, "b=%x\n", b);
871
872     hres = IWebBrowser2_put_MenuBar(wb, VARIANT_FALSE);
873     ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres);
874
875     hres = IWebBrowser2_get_MenuBar(wb, &b);
876     ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres);
877     ok(b == VARIANT_FALSE, "b=%x\n", b);
878
879     hres = IWebBrowser2_put_MenuBar(wb, 100);
880     ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres);
881
882     hres = IWebBrowser2_get_MenuBar(wb, &b);
883     ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres);
884     ok(b == VARIANT_TRUE, "b=%x\n", b);
885
886     /* AddressBar */
887
888     hres = IWebBrowser2_get_AddressBar(wb, &b);
889     ok(hres == S_OK, "get_AddressBar failed: %08x\n", hres);
890     ok(b == VARIANT_TRUE, "b=%x\n", b);
891
892     hres = IWebBrowser2_put_AddressBar(wb, VARIANT_FALSE);
893     ok(hres == S_OK, "put_AddressBar failed: %08x\n", hres);
894
895     hres = IWebBrowser2_get_AddressBar(wb, &b);
896     ok(hres == S_OK, "get_MenuBar failed: %08x\n", hres);
897     ok(b == VARIANT_FALSE, "b=%x\n", b);
898
899     hres = IWebBrowser2_put_AddressBar(wb, 100);
900     ok(hres == S_OK, "put_AddressBar failed: %08x\n", hres);
901
902     hres = IWebBrowser2_get_AddressBar(wb, &b);
903     ok(hres == S_OK, "get_AddressBar failed: %08x\n", hres);
904     ok(b == VARIANT_TRUE, "b=%x\n", b);
905
906     hres = IWebBrowser2_put_AddressBar(wb, VARIANT_TRUE);
907     ok(hres == S_OK, "put_MenuBar failed: %08x\n", hres);
908
909     /* StatusBar */
910
911     hres = IWebBrowser2_get_StatusBar(wb, &b);
912     ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres);
913     ok(b == VARIANT_TRUE, "b=%x\n", b);
914
915     hres = IWebBrowser2_put_StatusBar(wb, VARIANT_TRUE);
916     ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres);
917
918     hres = IWebBrowser2_get_StatusBar(wb, &b);
919     ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres);
920     ok(b == VARIANT_TRUE, "b=%x\n", b);
921
922     hres = IWebBrowser2_put_StatusBar(wb, VARIANT_FALSE);
923     ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres);
924
925     hres = IWebBrowser2_get_StatusBar(wb, &b);
926     ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres);
927     ok(b == VARIANT_FALSE, "b=%x\n", b);
928
929     hres = IWebBrowser2_put_StatusBar(wb, 100);
930     ok(hres == S_OK, "put_StatusBar failed: %08x\n", hres);
931
932     hres = IWebBrowser2_get_StatusBar(wb, &b);
933     ok(hres == S_OK, "get_StatusBar failed: %08x\n", hres);
934     ok(b == VARIANT_TRUE, "b=%x\n", b);
935
936     /* ToolBar */
937
938     hres = IWebBrowser2_get_ToolBar(wb, &i);
939     ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres);
940     ok(i == VARIANT_TRUE, "i=%x\n", i);
941
942     hres = IWebBrowser2_put_ToolBar(wb, VARIANT_FALSE);
943     ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres);
944
945     hres = IWebBrowser2_get_ToolBar(wb, &i);
946     ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres);
947     ok(i == VARIANT_FALSE, "b=%x\n", i);
948
949     hres = IWebBrowser2_put_ToolBar(wb, 100);
950     ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres);
951
952     hres = IWebBrowser2_get_ToolBar(wb, &i);
953     ok(hres == S_OK, "get_ToolBar failed: %08x\n", hres);
954     ok(i == VARIANT_TRUE, "i=%x\n", i);
955
956     hres = IWebBrowser2_put_ToolBar(wb, VARIANT_TRUE);
957     ok(hres == S_OK, "put_ToolBar failed: %08x\n", hres);
958
959     IWebBrowser2_Release(wb);
960 }
961
962 static void test_Silent(IUnknown *unk)
963 {
964     IWebBrowser2 *wb;
965     VARIANT_BOOL b;
966     HRESULT hres;
967
968     hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
969     ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
970     if(FAILED(hres))
971         return;
972
973     b = 100;
974     hres = IWebBrowser2_get_Silent(wb, &b);
975     ok(hres == S_OK, "get_Silent failed: %08x\n", hres);
976     ok(b == VARIANT_FALSE, "b=%x\n", b);
977
978     hres = IWebBrowser2_put_Silent(wb, VARIANT_TRUE);
979     ok(hres == S_OK, "set_Silent failed: %08x\n", hres);
980
981     b = 100;
982     hres = IWebBrowser2_get_Silent(wb, &b);
983     ok(hres == S_OK, "get_Silent failed: %08x\n", hres);
984     ok(b == VARIANT_TRUE, "b=%x\n", b);
985
986     hres = IWebBrowser2_put_Silent(wb, 100);
987     ok(hres == S_OK, "set_Silent failed: %08x\n", hres);
988
989     b = 100;
990     hres = IWebBrowser2_get_Silent(wb, &b);
991     ok(hres == S_OK, "get_Silent failed: %08x\n", hres);
992     ok(b == VARIANT_TRUE, "b=%x\n", b);
993
994     hres = IWebBrowser2_put_Silent(wb, VARIANT_FALSE);
995     ok(hres == S_OK, "set_Silent failed: %08x\n", hres);
996
997     b = 100;
998     hres = IWebBrowser2_get_Silent(wb, &b);
999     ok(hres == S_OK, "get_Silent failed: %08x\n", hres);
1000     ok(b == VARIANT_FALSE, "b=%x\n", b);
1001
1002     IWebBrowser_Release(wb);
1003 }
1004
1005 static void test_GetControlInfo(IUnknown *unk)
1006 {
1007     IOleControl *control;
1008     CONTROLINFO info;
1009     HRESULT hres;
1010
1011     hres = IUnknown_QueryInterface(unk, &IID_IOleControl, (void**)&control);
1012     ok(hres == S_OK, "Could not get IOleControl: %08x\n", hres);
1013     if(FAILED(hres))
1014         return;
1015
1016     hres = IOleControl_GetControlInfo(control, &info);
1017     ok(hres == E_NOTIMPL, "GetControlInfo failed: %08x, exxpected E_NOTIMPL\n", hres);
1018     hres = IOleControl_GetControlInfo(control, NULL);
1019     ok(hres == E_NOTIMPL, "GetControlInfo failed: %08x, exxpected E_NOTIMPL\n", hres);
1020
1021     IOleControl_Release(control);
1022 }
1023
1024 static void test_Extent(IUnknown *unk)
1025 {
1026     IOleObject *oleobj;
1027     SIZE size;
1028     HRESULT hres;
1029
1030     hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
1031     ok(hres == S_OK, "Could not get IOleObkect: %08x\n", hres);
1032     if(FAILED(hres))
1033         return;
1034
1035     size.cx = size.cy = 0xdeadbeef;
1036     hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
1037     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1038     ok(size.cx == 1323 && size.cy == 529, "size = {%d %d}\n", size.cx, size.cy);
1039
1040     size.cx = 800;
1041     size.cy = 700;
1042     hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &size);
1043     ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
1044
1045     size.cx = size.cy = 0xdeadbeef;
1046     hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
1047     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1048     ok(size.cx == 800 && size.cy == 700, "size = {%d %d}\n", size.cx, size.cy);
1049
1050     size.cx = size.cy = 0xdeadbeef;
1051     hres = IOleObject_GetExtent(oleobj, 0, &size);
1052     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1053     ok(size.cx == 800 && size.cy == 700, "size = {%d %d}\n", size.cx, size.cy);
1054
1055     size.cx = 900;
1056     size.cy = 800;
1057     hres = IOleObject_SetExtent(oleobj, 0, &size);
1058     ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
1059
1060     size.cx = size.cy = 0xdeadbeef;
1061     hres = IOleObject_GetExtent(oleobj, 0, &size);
1062     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1063     ok(size.cx == 900 && size.cy == 800, "size = {%d %d}\n", size.cx, size.cy);
1064
1065     size.cx = size.cy = 0xdeadbeef;
1066     hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size);
1067     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1068     ok(size.cx == 900 && size.cy == 800, "size = {%d %d}\n", size.cx, size.cy);
1069
1070     size.cx = 1000;
1071     size.cy = 900;
1072     hres = IOleObject_SetExtent(oleobj, 0xdeadbeef, &size);
1073     ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
1074
1075     size.cx = size.cy = 0xdeadbeef;
1076     hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size);
1077     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1078     ok(size.cx == 1000 && size.cy == 900, "size = {%d %d}\n", size.cx, size.cy);
1079
1080     size.cx = size.cy = 0xdeadbeef;
1081     hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
1082     ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
1083     ok(size.cx == 1000 && size.cy == 900, "size = {%d %d}\n", size.cx, size.cy);
1084
1085     IOleObject_Release(oleobj);
1086 }
1087
1088 static void test_QueryInterface(IUnknown *unk)
1089 {
1090     IQuickActivate *qa = (IQuickActivate*)0xdeadbeef;
1091     IRunnableObject *runnable = (IRunnableObject*)0xdeadbeef;
1092     HRESULT hres;
1093
1094     hres = IUnknown_QueryInterface(unk, &IID_IQuickActivate, (void**)&qa);
1095     ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres);
1096     ok(qa == NULL, "qa=%p, ezpected NULL\n", qa);
1097
1098     hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&runnable);
1099     ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres);
1100     ok(runnable == NULL, "runnable=%p, ezpected NULL\n", runnable);
1101 }
1102
1103 static void test_WebBrowser(void)
1104 {
1105     IUnknown *unk = NULL;
1106     ULONG ref;
1107     HRESULT hres;
1108
1109     hres = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1110             &IID_IUnknown, (void**)&unk);
1111     ok(hres == S_OK, "CoCreateInterface failed: %08x\n", hres);
1112     if(FAILED(hres))
1113         return;
1114
1115     test_QueryInterface(unk);
1116     test_ClassInfo(unk);
1117     test_ClientSite(unk, &ClientSite);
1118     test_Extent(unk);
1119     test_DoVerb(unk);
1120     test_ClientSite(unk, NULL);
1121     test_ie_funcs(unk);
1122     test_GetControlInfo(unk);
1123     test_Silent(unk);
1124
1125     ref = IUnknown_Release(unk);
1126     ok(ref == 0, "ref=%d, expected 0\n", ref);
1127 }
1128
1129 START_TEST(webbrowser)
1130 {
1131     container_hwnd = create_container_window();
1132
1133     OleInitialize(NULL);
1134
1135     test_WebBrowser();
1136
1137     OleUninitialize();
1138 }