2 * Copyright 2005-2007 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>
38 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
40 #define DEFINE_EXPECT(func) \
41 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
43 #define SET_EXPECT(func) \
44 expect_ ## func = TRUE
46 #define SET_CALLED(func) \
47 called_ ## func = TRUE
49 #define CHECK_EXPECT2(func) \
51 ok(expect_ ##func, "unexpected call " #func "\n"); \
52 called_ ## func = TRUE; \
55 #define CHECK_EXPECT(func) \
57 CHECK_EXPECT2(func); \
58 expect_ ## func = FALSE; \
61 #define CHECK_CALLED(func) \
63 ok(called_ ## func, "expected " #func "\n"); \
64 expect_ ## func = called_ ## func = FALSE; \
67 static IOleDocumentView
*view
= NULL
;
68 static HWND container_hwnd
= NULL
, hwnd
= NULL
, last_hwnd
= NULL
;
70 DEFINE_EXPECT(LockContainer
);
71 DEFINE_EXPECT(SetActiveObject
);
72 DEFINE_EXPECT(GetWindow
);
73 DEFINE_EXPECT(CanInPlaceActivate
);
74 DEFINE_EXPECT(OnInPlaceActivate
);
75 DEFINE_EXPECT(OnUIActivate
);
76 DEFINE_EXPECT(GetWindowContext
);
77 DEFINE_EXPECT(OnUIDeactivate
);
78 DEFINE_EXPECT(OnInPlaceDeactivate
);
79 DEFINE_EXPECT(GetContainer
);
80 DEFINE_EXPECT(ShowUI
);
81 DEFINE_EXPECT(ActivateMe
);
82 DEFINE_EXPECT(GetHostInfo
);
83 DEFINE_EXPECT(HideUI
);
84 DEFINE_EXPECT(GetOptionKeyPath
);
85 DEFINE_EXPECT(GetOverrideKeyPath
);
86 DEFINE_EXPECT(SetStatusText
);
87 DEFINE_EXPECT(QueryStatus_SETPROGRESSTEXT
);
88 DEFINE_EXPECT(QueryStatus_OPEN
);
89 DEFINE_EXPECT(QueryStatus_NEW
);
90 DEFINE_EXPECT(Exec_SETPROGRESSMAX
);
91 DEFINE_EXPECT(Exec_SETPROGRESSPOS
);
92 DEFINE_EXPECT(Exec_HTTPEQUIV_DONE
);
93 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_0
);
94 DEFINE_EXPECT(Exec_SETDOWNLOADSTATE_1
);
95 DEFINE_EXPECT(Exec_ShellDocView_37
);
96 DEFINE_EXPECT(Exec_UPDATECOMMANDS
);
97 DEFINE_EXPECT(Exec_SETTITLE
);
98 DEFINE_EXPECT(Exec_HTTPEQUIV
);
99 DEFINE_EXPECT(Exec_MSHTML_PARSECOMPLETE
);
100 DEFINE_EXPECT(Invoke_AMBIENT_USERMODE
);
101 DEFINE_EXPECT(Invoke_AMBIENT_DLCONTROL
);
102 DEFINE_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
103 DEFINE_EXPECT(Invoke_AMBIENT_SILENT
);
104 DEFINE_EXPECT(Invoke_AMBIENT_USERAGENT
);
105 DEFINE_EXPECT(Invoke_AMBIENT_PALETTE
);
106 DEFINE_EXPECT(GetDropTarget
);
107 DEFINE_EXPECT(UpdateUI
);
108 DEFINE_EXPECT(Navigate
);
109 DEFINE_EXPECT(OnFrameWindowActivate
);
110 DEFINE_EXPECT(OnChanged_READYSTATE
);
111 DEFINE_EXPECT(OnChanged_1005
);
112 DEFINE_EXPECT(GetDisplayName
);
113 DEFINE_EXPECT(BindToStorage
);
114 DEFINE_EXPECT(Abort
);
116 DEFINE_EXPECT(CreateInstance
);
117 DEFINE_EXPECT(Start
);
118 DEFINE_EXPECT(Terminate
);
119 DEFINE_EXPECT(Protocol_Read
);
120 DEFINE_EXPECT(LockRequest
);
121 DEFINE_EXPECT(UnlockRequest
);
123 static IUnknown
*doc_unk
;
124 static BOOL expect_LockContainer_fLock
;
125 static BOOL expect_SetActiveObject_active
;
126 static BOOL set_clientsite
= FALSE
, container_locked
= FALSE
;
127 static BOOL readystate_set_loading
= FALSE
, load_from_stream
;
128 static BOOL editmode
= FALSE
;
129 static int stream_read
, protocol_read
;
130 static enum load_state_t
{
138 static LPCOLESTR expect_status_text
= NULL
;
140 static const char html_page
[] =
142 "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\"></head>"
146 static const char css_data
[] = "body {color: red}";
148 static const WCHAR doc_url
[] = {'w','i','n','e','t','e','s','t',':','d','o','c',0};
149 static const WCHAR about_blank_url
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
151 static HRESULT
QueryInterface(REFIID riid
, void **ppv
);
152 static void test_readyState(IUnknown
*);
153 static void test_MSHTML_QueryStatus(IUnknown
*,DWORD
);
154 static BOOL nogecko
= FALSE
;
156 static void test_GetCurMoniker(IUnknown
*,IMoniker
*,LPCWSTR
);
158 static const WCHAR wszTimesNewRoman
[] =
159 {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
160 static const WCHAR wszArial
[] =
161 {'A','r','i','a','l',0};
163 #define EXPECT_UPDATEUI 1
164 #define EXPECT_SETTITLE 2
166 static void test_timer(DWORD flags
)
168 BOOL
*b
= &called_Exec_SETTITLE
;
171 if(flags
& EXPECT_UPDATEUI
) {
172 SET_EXPECT(UpdateUI
);
173 SET_EXPECT(Exec_UPDATECOMMANDS
);
174 b
= &called_UpdateUI
;
176 if(flags
& EXPECT_SETTITLE
)
177 SET_EXPECT(Exec_SETTITLE
);
179 while(!*b
&& GetMessage(&msg
, hwnd
, 0, 0)) {
180 TranslateMessage(&msg
);
181 DispatchMessage(&msg
);
184 if(flags
& EXPECT_UPDATEUI
) {
185 CHECK_CALLED(UpdateUI
);
186 CHECK_CALLED(Exec_UPDATECOMMANDS
);
188 if(flags
& EXPECT_SETTITLE
)
189 CHECK_CALLED(Exec_SETTITLE
);
192 static HRESULT WINAPI
Protocol_QueryInterface(IInternetProtocol
*iface
, REFIID riid
, void **ppv
)
194 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IInternetProtocol
, riid
)) {
200 return E_NOINTERFACE
;
203 static ULONG WINAPI
Protocol_AddRef(IInternetProtocol
*iface
)
208 static ULONG WINAPI
Protocol_Release(IInternetProtocol
*iface
)
213 static HRESULT WINAPI
Protocol_Start(IInternetProtocol
*iface
, LPCWSTR szUrl
,
214 IInternetProtocolSink
*pOIProtSink
, IInternetBindInfo
*pOIBindInfo
,
215 DWORD grfPI
, DWORD dwReserved
)
221 static const WCHAR wszTextCss
[] = {'t','e','x','t','/','c','s','s',0};
222 static const WCHAR empty_str
= {0};
226 ok(pOIProtSink
!= NULL
, "pOIProtSink == NULL\n");
227 ok(pOIBindInfo
!= NULL
, "pOIBindInfo == NULL\n");
228 ok(!grfPI
, "grfPI = %x\n", grfPI
);
229 ok(!dwReserved
, "dwReserved = %d\n", dwReserved
);
231 memset(&bindinfo
, 0, sizeof(bindinfo
));
232 bindinfo
.cbSize
= sizeof(bindinfo
);
233 hres
= IInternetBindInfo_GetBindInfo(pOIBindInfo
, &bindf
, &bindinfo
);
234 ok(hres
== S_OK
, "GetBindInfo failed: %08x\n", hres
);
235 ok(bindf
== (BINDF_FROMURLMON
|BINDF_PULLDATA
|BINDF_NEEDFILE
|BINDF_ASYNCSTORAGE
|BINDF_ASYNCHRONOUS
),
236 "bindf = %x\n", bindf
);
238 ok(bindinfo
.cbSize
== sizeof(bindinfo
), "bindinfo.cbSize=%d\n", bindinfo
.cbSize
);
239 ok(bindinfo
.szExtraInfo
== NULL
, "bindinfo.szExtraInfo=%p\n", bindinfo
.szExtraInfo
);
240 /* TODO: test stgmedData */
241 ok(bindinfo
.grfBindInfoF
== 0, "bindinfo.grfBinfInfoF=%08x\n", bindinfo
.grfBindInfoF
);
242 ok(bindinfo
.dwBindVerb
== 0, "bindinfo.dwBindVerb=%d\n", bindinfo
.dwBindVerb
);
243 ok(bindinfo
.szCustomVerb
== 0, "bindinfo.szCustomVerb=%p\n", bindinfo
.szCustomVerb
);
244 ok(bindinfo
.cbstgmedData
== 0, "bindinfo.cbstgmedData=%d\n", bindinfo
.cbstgmedData
);
245 ok(bindinfo
.dwOptions
== 0x80000, "bindinfo.dwOptions=%x\n", bindinfo
.dwOptions
);
246 ok(bindinfo
.dwOptionsFlags
== 0, "bindinfo.dwOptionsFlags=%d\n", bindinfo
.dwOptionsFlags
);
247 /* TODO: test dwCodePage */
248 /* TODO: test securityAttributes */
249 ok(IsEqualGUID(&IID_NULL
, &bindinfo
.iid
), "unexpected bindinfo.iid\n");
250 ok(bindinfo
.pUnk
== NULL
, "bindinfo.pUnk=%p\n", bindinfo
.pUnk
);
251 ok(bindinfo
.dwReserved
== 0, "bindinfo.dwReserved=%d\n", bindinfo
.dwReserved
);
253 hres
= IInternetProtocolSink_ReportProgress(pOIProtSink
,
254 BINDSTATUS_CACHEFILENAMEAVAILABLE
, &empty_str
);
255 ok(hres
== S_OK
, "ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x\n", hres
);
257 hres
= IInternetProtocolSink_ReportProgress(pOIProtSink
,
258 BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE
, wszTextCss
);
260 "ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE) failed: %08x\n", hres
);
262 hres
= IInternetProtocolSink_ReportData(pOIProtSink
,
263 BSCF_FIRSTDATANOTIFICATION
| BSCF_LASTDATANOTIFICATION
, 13, 13);
264 ok(hres
== S_OK
, "ReportData failed: %08x\n", hres
);
266 hres
= IInternetProtocolSink_ReportResult(pOIProtSink
, S_OK
, 0, NULL
);
267 ok(hres
== S_OK
, "ReportResult failed: %08x\n", hres
);
272 static HRESULT WINAPI
Protocol_Continue(IInternetProtocol
*iface
,
273 PROTOCOLDATA
*pProtocolData
)
275 ok(0, "unexpected call\n");
279 static HRESULT WINAPI
Protocol_Abort(IInternetProtocol
*iface
, HRESULT hrReason
,
282 ok(0, "unexpected call\n");
286 static HRESULT WINAPI
Protocol_Terminate(IInternetProtocol
*iface
, DWORD dwOptions
)
288 CHECK_EXPECT(Terminate
);
292 static HRESULT WINAPI
Protocol_Suspend(IInternetProtocol
*iface
)
294 ok(0, "unexpected call\n");
298 static HRESULT WINAPI
Protocol_Resume(IInternetProtocol
*iface
)
300 ok(0, "unexpected call\n");
304 static HRESULT WINAPI
Protocol_Read(IInternetProtocol
*iface
, void *pv
,
305 ULONG cb
, ULONG
*pcbRead
)
307 CHECK_EXPECT2(Protocol_Read
);
309 ok(pv
!= NULL
, "pv == NULL\n");
310 ok(cb
> sizeof(css_data
), "cb < sizeof(css_data)\n");
311 ok(pcbRead
!= NULL
, "pcbRead == NULL\n");
312 ok(!*pcbRead
, "*pcbRead=%d\n", *pcbRead
);
317 protocol_read
+= *pcbRead
= sizeof(css_data
)-1;
318 memcpy(pv
, css_data
, sizeof(css_data
)-1);
322 static HRESULT WINAPI
Protocol_Seek(IInternetProtocol
*iface
,
323 LARGE_INTEGER dlibMove
, DWORD dwOrigin
, ULARGE_INTEGER
*plibNewPosition
)
325 ok(0, "unexpected call\n");
329 static HRESULT WINAPI
Protocol_LockRequest(IInternetProtocol
*iface
, DWORD dwOptions
)
331 CHECK_EXPECT(LockRequest
);
335 static HRESULT WINAPI
Protocol_UnlockRequest(IInternetProtocol
*iface
)
337 CHECK_EXPECT(UnlockRequest
);
341 static const IInternetProtocolVtbl ProtocolVtbl
= {
342 Protocol_QueryInterface
,
353 Protocol_LockRequest
,
354 Protocol_UnlockRequest
357 static IInternetProtocol Protocol
= { &ProtocolVtbl
};
359 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
361 if(!IsEqualGUID(&IID_IInternetProtocolInfo
, riid
))
362 ok(0, "unexpected call\n");
363 return E_NOINTERFACE
;
366 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
371 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
376 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
377 REFIID riid
, void **ppv
)
379 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
))
380 return E_NOINTERFACE
;
382 CHECK_EXPECT(CreateInstance
);
383 ok(ppv
!= NULL
, "ppv == NULL\n");
389 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
391 ok(0, "unexpected call\n");
395 static const IClassFactoryVtbl ClassFactoryVtbl
= {
396 ClassFactory_QueryInterface
,
398 ClassFactory_Release
,
399 ClassFactory_CreateInstance
,
400 ClassFactory_LockServer
403 static IClassFactory ClassFactory
= { &ClassFactoryVtbl
};
405 static HRESULT WINAPI
HlinkFrame_QueryInterface(IHlinkFrame
*iface
, REFIID riid
, void **ppv
)
407 ok(0, "unexpected call\n");
411 static ULONG WINAPI
HlinkFrame_AddRef(IHlinkFrame
*iface
)
416 static ULONG WINAPI
HlinkFrame_Release(IHlinkFrame
*iface
)
421 static HRESULT WINAPI
HlinkFrame_SetBrowseContext(IHlinkFrame
*iface
,
422 IHlinkBrowseContext
*pihlbc
)
424 ok(0, "unexpected call\n");
428 static HRESULT WINAPI
HlinkFrame_GetBrowseContext(IHlinkFrame
*iface
,
429 IHlinkBrowseContext
**ppihlbc
)
431 ok(0, "unexpected call\n");
435 static HRESULT WINAPI
HlinkFrame_Navigate(IHlinkFrame
*iface
, DWORD grfHLNF
, LPBC pbc
,
436 IBindStatusCallback
*pibsc
, IHlink
*pihlNavigate
)
440 CHECK_EXPECT(Navigate
);
442 ok(grfHLNF
== 0, "grfHLNF=%d, expected 0\n", grfHLNF
);
443 ok(pbc
!= NULL
, "pbc == NULL\n");
444 ok(pibsc
!= NULL
, "pubsc == NULL\n");
445 ok(pihlNavigate
!= NULL
, "puhlNavigate == NULL\n");
448 LPWSTR frame_name
= (LPWSTR
)0xdeadbeef;
449 LPWSTR location
= (LPWSTR
)0xdeadbeef;
451 IMoniker
*mon
= NULL
;
452 DWORD site_data
= 0xdeadbeef;
454 hres
= IHlink_GetTargetFrameName(pihlNavigate
, &frame_name
);
455 ok(hres
== S_FALSE
, "GetTargetFrameName failed: %08x\n", hres
);
456 ok(frame_name
== NULL
, "frame_name = %p\n", frame_name
);
458 hres
= IHlink_GetMonikerReference(pihlNavigate
, 1, &mon
, &location
);
459 ok(hres
== S_OK
, "GetMonikerReference failed: %08x\n", hres
);
460 ok(location
== NULL
, "location = %p\n", location
);
461 ok(mon
!= NULL
, "mon == NULL\n");
463 hres
= IHlink_GetHlinkSite(pihlNavigate
, &site
, &site_data
);
464 ok(hres
== S_OK
, "GetHlinkSite failed: %08x\n", hres
);
465 ok(site
== NULL
, "site = %p\n, expected NULL\n", site
);
466 ok(site_data
== 0xdeadbeef, "site_data = %x\n", site_data
);
472 static HRESULT WINAPI
HlinkFrame_OnNavigate(IHlinkFrame
*iface
, DWORD grfHLNF
,
473 IMoniker
*pimkTarget
, LPCWSTR pwzLocation
, LPCWSTR pwzFriendlyName
, DWORD dwreserved
)
475 ok(0, "unexpected call\n");
479 static HRESULT WINAPI
HlinkFrame_UpdateHlink(IHlinkFrame
*iface
, ULONG uHLID
,
480 IMoniker
*pimkTarget
, LPCWSTR pwzLocation
, LPCWSTR pwzFriendlyName
)
482 ok(0, "unexpected call\n");
486 static const IHlinkFrameVtbl HlinkFrameVtbl
= {
487 HlinkFrame_QueryInterface
,
490 HlinkFrame_SetBrowseContext
,
491 HlinkFrame_GetBrowseContext
,
493 HlinkFrame_OnNavigate
,
494 HlinkFrame_UpdateHlink
497 static IHlinkFrame HlinkFrame
= { &HlinkFrameVtbl
};
499 static HRESULT WINAPI
PropertyNotifySink_QueryInterface(IPropertyNotifySink
*iface
,
500 REFIID riid
, void**ppv
)
502 if(IsEqualGUID(&IID_IPropertyNotifySink
, riid
)) {
507 ok(0, "unexpected call\n");
508 return E_NOINTERFACE
;
511 static ULONG WINAPI
PropertyNotifySink_AddRef(IPropertyNotifySink
*iface
)
516 static ULONG WINAPI
PropertyNotifySink_Release(IPropertyNotifySink
*iface
)
521 static HRESULT WINAPI
PropertyNotifySink_OnChanged(IPropertyNotifySink
*iface
, DISPID dispID
)
524 case DISPID_READYSTATE
:
525 CHECK_EXPECT2(OnChanged_READYSTATE
);
526 test_MSHTML_QueryStatus(NULL
, OLECMDF_SUPPORTED
527 | (editmode
&& (load_state
== LD_INTERACTIVE
|| load_state
== LD_COMPLETE
)
528 ? OLECMDF_ENABLED
: 0));
530 if(readystate_set_loading
) {
531 readystate_set_loading
= FALSE
;
532 load_state
= LD_LOADING
;
534 test_readyState(NULL
);
537 CHECK_EXPECT(OnChanged_1005
);
538 test_readyState(NULL
);
539 load_state
= LD_INTERACTIVE
;
543 ok(0, "unexpected id %d\n", dispID
);
547 static HRESULT WINAPI
PropertyNotifySink_OnRequestEdit(IPropertyNotifySink
*iface
, DISPID dispID
)
549 ok(0, "unexpected call\n");
553 static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
= {
554 PropertyNotifySink_QueryInterface
,
555 PropertyNotifySink_AddRef
,
556 PropertyNotifySink_Release
,
557 PropertyNotifySink_OnChanged
,
558 PropertyNotifySink_OnRequestEdit
561 static IPropertyNotifySink PropertyNotifySink
= { &PropertyNotifySinkVtbl
};
563 static HRESULT WINAPI
Stream_QueryInterface(IStream
*iface
, REFIID riid
, void **ppv
)
565 ok(0, "unexpected call\n");
566 return E_NOINTERFACE
;
569 static ULONG WINAPI
Stream_AddRef(IStream
*iface
)
574 static ULONG WINAPI
Stream_Release(IStream
*iface
)
579 static HRESULT WINAPI
Stream_Read(IStream
*iface
, void *pv
,
580 ULONG cb
, ULONG
*pcbRead
)
583 ok(pv
!= NULL
, "pv == NULL\n");
584 ok(cb
> sizeof(html_page
), "cb = %d\n", cb
);
585 ok(pcbRead
!= NULL
, "pcbRead == NULL\n");
586 ok(!*pcbRead
, "*pcbRead = %d\n", *pcbRead
);
591 memcpy(pv
, html_page
, sizeof(html_page
)-1);
592 stream_read
+= *pcbRead
= sizeof(html_page
)-1;
596 static HRESULT WINAPI
Stream_Write(IStream
*iface
, const void *pv
,
597 ULONG cb
, ULONG
*pcbWritten
)
599 ok(0, "unexpected call\n");
603 static HRESULT WINAPI
Stream_Seek(IStream
*iface
, LARGE_INTEGER dlibMove
,
604 DWORD dwOrigin
, ULARGE_INTEGER
*plibNewPosition
)
606 ok(0, "unexpected call\n");
610 static HRESULT WINAPI
Stream_SetSize(IStream
*iface
, ULARGE_INTEGER libNewSize
)
612 ok(0, "unexpected call\n");
616 static HRESULT WINAPI
Stream_CopyTo(IStream
*iface
, IStream
*pstm
,
617 ULARGE_INTEGER cb
, ULARGE_INTEGER
*pcbRead
, ULARGE_INTEGER
*pcbWritten
)
619 ok(0, "unexpected call\n");
623 static HRESULT WINAPI
Stream_Commit(IStream
*iface
, DWORD grfCommitFlags
)
625 ok(0, "unexpected call\n");
629 static HRESULT WINAPI
Stream_Revert(IStream
*iface
)
631 ok(0, "unexpected call\n");
635 static HRESULT WINAPI
Stream_LockRegion(IStream
*iface
, ULARGE_INTEGER libOffset
,
636 ULARGE_INTEGER cb
, DWORD dwLockType
)
638 ok(0, "unexpected call\n");
642 static HRESULT WINAPI
Stream_UnlockRegion(IStream
*iface
,
643 ULARGE_INTEGER libOffset
, ULARGE_INTEGER cb
, DWORD dwLockType
)
645 ok(0, "unexpected call\n");
649 static HRESULT WINAPI
Stream_Stat(IStream
*iface
, STATSTG
*pstatstg
,
652 ok(0, "unexpected call\n");
656 static HRESULT WINAPI
Stream_Clone(IStream
*iface
, IStream
**ppstm
)
658 ok(0, "unexpected call\n");
662 static const IStreamVtbl StreamVtbl
= {
663 Stream_QueryInterface
,
679 static IStream Stream
= { &StreamVtbl
};
681 static HRESULT WINAPI
Binding_QueryInterface(IBinding
*iface
, REFIID riid
, void **ppv
)
683 if(IsEqualGUID(&IID_IWinInetHttpInfo
, riid
))
684 return E_NOINTERFACE
; /* TODO */
686 if(IsEqualGUID(&IID_IWinInetInfo
, riid
))
687 return E_NOINTERFACE
; /* TODO */
689 ok(0, "unexpected call\n");
690 return E_NOINTERFACE
;
693 static ULONG WINAPI
Binding_AddRef(IBinding
*iface
)
698 static ULONG WINAPI
Binding_Release(IBinding
*iface
)
703 static HRESULT WINAPI
Binding_Abort(IBinding
*iface
)
709 static HRESULT WINAPI
Binding_Suspend(IBinding
*iface
)
711 ok(0, "unexpected call\n");
715 static HRESULT WINAPI
Binding_Resume(IBinding
*iface
)
717 ok(0, "unexpected call\n");
721 static HRESULT WINAPI
Binding_SetPriority(IBinding
*iface
, LONG nPriority
)
723 ok(0, "unexpected call\n");
727 static HRESULT WINAPI
Binding_GetPriority(IBinding
*iface
, LONG
*pnPriority
)
729 ok(0, "unexpected call\n");
733 static HRESULT WINAPI
Binding_GetBindResult(IBinding
*iface
, CLSID
*pclsidProtocol
,
734 DWORD
*pdwResult
, LPOLESTR
*pszResult
, DWORD
*pdwReserved
)
736 ok(0, "unexpected call\n");
740 static const IBindingVtbl BindingVtbl
= {
741 Binding_QueryInterface
,
749 Binding_GetBindResult
752 static IBinding Binding
= { &BindingVtbl
};
754 static HRESULT WINAPI
Moniker_QueryInterface(IMoniker
*iface
, REFIID riid
, void **ppv
)
756 ok(0, "unexpected call\n");
757 return E_NOINTERFACE
;
760 static ULONG WINAPI
Moniker_AddRef(IMoniker
*iface
)
765 static ULONG WINAPI
Moniker_Release(IMoniker
*iface
)
770 static HRESULT WINAPI
Moniker_GetClassID(IMoniker
*iface
, CLSID
*pClassID
)
772 ok(0, "unexpected call\n");
776 static HRESULT WINAPI
Moniker_IsDirty(IMoniker
*iface
)
778 ok(0, "unexpected call\n");
782 static HRESULT WINAPI
Moniker_Load(IMoniker
*iface
, IStream
*pStm
)
784 ok(0, "unexpected call\n");
788 static HRESULT WINAPI
Moniker_Save(IMoniker
*iface
, IStream
*pStm
, BOOL fClearDirty
)
790 ok(0, "unexpected call\n");
794 static HRESULT WINAPI
Moniker_GetSizeMax(IMoniker
*iface
, ULARGE_INTEGER
*pcbSize
)
796 ok(0, "unexpected call\n");
800 static HRESULT WINAPI
Moniker_BindToObject(IMoniker
*iface
, IBindCtx
*pcb
, IMoniker
*pmkToLeft
,
801 REFIID riidResult
, void **ppvResult
)
803 ok(0, "unexpected call\n");
807 static HRESULT WINAPI
Moniker_BindToStorage(IMoniker
*iface
, IBindCtx
*pbc
, IMoniker
*pmkToLeft
,
808 REFIID riid
, void **ppv
)
810 IBindStatusCallback
*callback
= NULL
;
811 FORMATETC formatetc
= {0xc02d, NULL
, 1, -1, TYMED_ISTREAM
};
817 static OLECHAR BSCBHolder
[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
818 static const WCHAR wszTextHtml
[] = {'t','e','x','t','/','h','t','m','l',0};
820 CHECK_EXPECT(BindToStorage
);
822 ok(pbc
!= NULL
, "pbc == NULL\n");
823 ok(pmkToLeft
== NULL
, "pmkToLeft=%p\n", pmkToLeft
);
824 ok(IsEqualGUID(&IID_IStream
, riid
), "unexpected riid\n");
825 ok(ppv
!= NULL
, "ppv == NULL\n");
826 ok(*ppv
== NULL
, "*ppv=%p\n", *ppv
);
828 hres
= IBindCtx_GetObjectParam(pbc
, BSCBHolder
, (IUnknown
**)&callback
);
829 ok(hres
== S_OK
, "GetObjectParam failed: %08x\n", hres
);
830 ok(callback
!= NULL
, "callback == NULL\n");
832 memset(&bindinfo
, 0xf0, sizeof(bindinfo
));
833 bindinfo
.cbSize
= sizeof(bindinfo
);
835 hres
= IBindStatusCallback_GetBindInfo(callback
, &bindf
, &bindinfo
);
836 ok(hres
== S_OK
, "GetBindInfo failed: %08x\n", hres
);
837 ok(bindf
== (BINDF_PULLDATA
|BINDF_ASYNCSTORAGE
|BINDF_ASYNCHRONOUS
), "bindf = %08x\n", bindf
);
838 ok(bindinfo
.cbSize
== sizeof(bindinfo
), "bindinfo.cbSize=%d\n", bindinfo
.cbSize
);
839 ok(bindinfo
.szExtraInfo
== NULL
, "bindinfo.szExtraInfo=%p\n", bindinfo
.szExtraInfo
);
840 /* TODO: test stgmedData */
841 ok(bindinfo
.grfBindInfoF
== 0, "bindinfo.grfBinfInfoF=%08x\n", bindinfo
.grfBindInfoF
);
842 ok(bindinfo
.dwBindVerb
== 0, "bindinfo.dwBindVerb=%d\n", bindinfo
.dwBindVerb
);
843 ok(bindinfo
.szCustomVerb
== 0, "bindinfo.szCustomVerb=%p\n", bindinfo
.szCustomVerb
);
844 ok(bindinfo
.cbstgmedData
== 0, "bindinfo.cbstgmedData=%d\n", bindinfo
.cbstgmedData
);
845 ok(bindinfo
.dwOptions
== 0x80000 || bindinfo
.dwOptions
== 0x4080000,
846 "bindinfo.dwOptions=%x\n", bindinfo
.dwOptions
);
847 ok(bindinfo
.dwOptionsFlags
== 0, "bindinfo.dwOptionsFlags=%d\n", bindinfo
.dwOptionsFlags
);
848 /* TODO: test dwCodePage */
849 /* TODO: test securityAttributes */
850 ok(IsEqualGUID(&IID_NULL
, &bindinfo
.iid
), "unexpected bindinfo.iid\n");
851 ok(bindinfo
.pUnk
== NULL
, "bindinfo.pUnk=%p\n", bindinfo
.pUnk
);
852 ok(bindinfo
.dwReserved
== 0, "bindinfo.dwReserved=%d\n", bindinfo
.dwReserved
);
854 hres
= IBindStatusCallback_OnStartBinding(callback
, 0, &Binding
);
855 ok(hres
== S_OK
, "OnStartBinding failed: %08x\n", hres
);
857 hres
= IBindStatusCallback_OnProgress(callback
, 0, 0, BINDSTATUS_MIMETYPEAVAILABLE
,
859 ok(hres
== S_OK
, "OnProgress(BINDSTATUS_MIMETYPEAVAILABLE) failed: %08x\n", hres
);
861 hres
= IBindStatusCallback_OnProgress(callback
, sizeof(html_page
)-1, sizeof(html_page
)-1,
862 BINDSTATUS_BEGINDOWNLOADDATA
, doc_url
);
863 ok(hres
== S_OK
, "OnProgress(BINDSTATUS_BEGINDOWNLOADDATA) failed: %08x\n", hres
);
866 stgmedium
.tymed
= TYMED_ISTREAM
;
867 U(stgmedium
).pstm
= &Stream
;
868 stgmedium
.pUnkForRelease
= (IUnknown
*)iface
;
869 hres
= IBindStatusCallback_OnDataAvailable(callback
,
870 BSCF_FIRSTDATANOTIFICATION
|BSCF_LASTDATANOTIFICATION
,
871 sizeof(html_page
)-1, &formatetc
, &stgmedium
);
872 ok(hres
== S_OK
, "OnDataAvailable failed: %08x\n", hres
);
875 hres
= IBindStatusCallback_OnProgress(callback
, sizeof(html_page
)-1, sizeof(html_page
)-1,
876 BINDSTATUS_ENDDOWNLOADDATA
, NULL
);
877 ok(hres
== S_OK
, "OnProgress(BINDSTATUS_ENDDOWNLOADDATA) failed: %08x\n", hres
);
879 hres
= IBindStatusCallback_OnStopBinding(callback
, S_OK
, NULL
);
880 ok(hres
== S_OK
, "OnStopBinding failed: %08x\n", hres
);
882 IBindStatusCallback_Release(callback
);
887 static HRESULT WINAPI
Moniker_Reduce(IMoniker
*iface
, IBindCtx
*pbc
, DWORD dwReduceHowFar
,
888 IMoniker
**ppmkToLeft
, IMoniker
**ppmkReduced
)
890 ok(0, "unexpected call\n");
894 static HRESULT WINAPI
Moniker_ComposeWith(IMoniker
*iface
, IMoniker
*pmkRight
,
895 BOOL fOnlyIfNotGeneric
, IMoniker
**ppnkComposite
)
897 ok(0, "unexpected call\n");
901 static HRESULT WINAPI
Moniker_Enum(IMoniker
*iface
, BOOL fForwrd
, IEnumMoniker
**ppenumMoniker
)
903 ok(0, "unexpected call\n");
907 static HRESULT WINAPI
Moniker_IsEqual(IMoniker
*iface
, IMoniker
*pmkOtherMoniker
)
909 ok(0, "unexpected call\n");
913 static HRESULT WINAPI
Moniker_Hash(IMoniker
*iface
, DWORD
*pdwHash
)
915 ok(0, "unexpected call\n");
919 static HRESULT WINAPI
Moniker_IsRunning(IMoniker
*iface
, IBindCtx
*pbc
, IMoniker
*pmkToLeft
,
920 IMoniker
*pmkNewlyRunning
)
922 ok(0, "unexpected call\n");
926 static HRESULT WINAPI
Moniker_GetTimeOfLastChange(IMoniker
*iface
, IBindCtx
*pbc
,
927 IMoniker
*pmkToLeft
, FILETIME
*pFileTime
)
929 ok(0, "unexpected call\n");
933 static HRESULT WINAPI
Moniker_Inverse(IMoniker
*iface
, IMoniker
**ppmk
)
935 ok(0, "unexpected call\n");
939 static HRESULT WINAPI
Moniker_CommonPrefixWith(IMoniker
*iface
, IMoniker
*pmkOther
,
940 IMoniker
**ppmkPrefix
)
942 ok(0, "unexpected call\n");
946 static HRESULT WINAPI
Moniker_RelativePathTo(IMoniker
*iface
, IMoniker
*pmkOther
,
947 IMoniker
**pmkRelPath
)
949 ok(0, "unexpected call\n");
953 static HRESULT WINAPI
Moniker_GetDisplayName(IMoniker
*iface
, IBindCtx
*pbc
,
954 IMoniker
*pmkToLeft
, LPOLESTR
*ppszDisplayName
)
956 CHECK_EXPECT2(GetDisplayName
);
958 /* ok(pbc != NULL, "pbc == NULL\n"); */
959 ok(pmkToLeft
== NULL
, "pmkToLeft=%p\n", pmkToLeft
);
960 ok(ppszDisplayName
!= NULL
, "ppszDisplayName == NULL\n");
962 *ppszDisplayName
= CoTaskMemAlloc(sizeof(doc_url
));
963 memcpy(*ppszDisplayName
, doc_url
, sizeof(doc_url
));
968 static HRESULT WINAPI
Moniker_ParseDisplayName(IMoniker
*iface
, IBindCtx
*pbc
,
969 IMoniker
*pmkToLeft
, LPOLESTR pszDisplayName
, ULONG
*pchEaten
, IMoniker
**ppmkOut
)
971 ok(0, "unexpected call\n");
975 static HRESULT WINAPI
Moniker_IsSystemMoniker(IMoniker
*iface
, DWORD
*pdwMksys
)
977 ok(0, "unexpected call\n");
981 static const IMonikerVtbl MonikerVtbl
= {
982 Moniker_QueryInterface
,
990 Moniker_BindToObject
,
991 Moniker_BindToStorage
,
998 Moniker_GetTimeOfLastChange
,
1000 Moniker_CommonPrefixWith
,
1001 Moniker_RelativePathTo
,
1002 Moniker_GetDisplayName
,
1003 Moniker_ParseDisplayName
,
1004 Moniker_IsSystemMoniker
1007 static IMoniker Moniker
= { &MonikerVtbl
};
1009 static HRESULT WINAPI
OleContainer_QueryInterface(IOleContainer
*iface
, REFIID riid
, void **ppv
)
1011 return QueryInterface(riid
, ppv
);
1014 static ULONG WINAPI
OleContainer_AddRef(IOleContainer
*iface
)
1019 static ULONG WINAPI
OleContainer_Release(IOleContainer
*iface
)
1024 static HRESULT WINAPI
OleContainer_ParseDisplayName(IOleContainer
*iface
, IBindCtx
*pbc
,
1025 LPOLESTR pszDiaplayName
, ULONG
*pchEaten
, IMoniker
**ppmkOut
)
1027 ok(0, "unexpected call\n");
1031 static HRESULT WINAPI
OleContainer_EnumObjects(IOleContainer
*iface
, DWORD grfFlags
,
1032 IEnumUnknown
**ppenum
)
1034 ok(0, "unexpected call\n");
1038 static HRESULT WINAPI
OleContainer_LockContainer(IOleContainer
*iface
, BOOL fLock
)
1040 CHECK_EXPECT(LockContainer
);
1041 ok(expect_LockContainer_fLock
== fLock
, "fLock=%x, expected %x\n", fLock
, expect_LockContainer_fLock
);
1045 static const IOleContainerVtbl OleContainerVtbl
= {
1046 OleContainer_QueryInterface
,
1047 OleContainer_AddRef
,
1048 OleContainer_Release
,
1049 OleContainer_ParseDisplayName
,
1050 OleContainer_EnumObjects
,
1051 OleContainer_LockContainer
1054 static IOleContainer OleContainer
= { &OleContainerVtbl
};
1056 static HRESULT WINAPI
InPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
, REFIID riid
, void **ppv
)
1058 return QueryInterface(riid
, ppv
);
1061 static ULONG WINAPI
InPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
1066 static ULONG WINAPI
InPlaceFrame_Release(IOleInPlaceFrame
*iface
)
1071 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
1073 ok(0, "unexpected call\n");
1077 static HRESULT WINAPI
InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
1079 ok(0, "unexpected call\n");
1083 static HRESULT WINAPI
InPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
1085 ok(0, "unexpected call\n");
1089 static HRESULT WINAPI
InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
,
1090 LPCBORDERWIDTHS pborderwidths
)
1092 ok(0, "unexpected call\n");
1096 static HRESULT WINAPI
InPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
,
1097 LPCBORDERWIDTHS pborderwidths
)
1099 ok(0, "unexpected call\n");
1103 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
1104 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
1106 static const WCHAR wszHTML_Document
[] =
1107 {'H','T','M','L',' ','D','o','c','u','m','e','n','t',0};
1109 CHECK_EXPECT2(SetActiveObject
);
1111 if(expect_SetActiveObject_active
) {
1112 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
1113 if(pActiveObject
&& PRIMARYLANGID(GetSystemDefaultLangID()) == LANG_ENGLISH
)
1114 ok(!lstrcmpW(wszHTML_Document
, pszObjName
), "pszObjName != \"HTML Document\"\n");
1116 ok(pActiveObject
== NULL
, "pActiveObject=%p, expected NULL\n", pActiveObject
);
1117 ok(pszObjName
== NULL
, "pszObjName=%p, expected NULL\n", pszObjName
);
1123 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
1124 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
1126 ok(0, "unexpected call\n");
1130 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
1131 HOLEMENU holemenu
, HWND hwndActiveObject
)
1133 ok(0, "unexpected call\n");
1137 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
1139 ok(0, "unexpected call\n");
1143 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
1145 CHECK_EXPECT2(SetStatusText
);
1146 if(!expect_status_text
)
1147 ok(pszStatusText
== NULL
, "pszStatusText=%p, expected NULL\n", pszStatusText
);
1151 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
1153 ok(0, "unexpected call\n");
1157 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
1159 ok(0, "unexpected call\n");
1163 static const IOleInPlaceFrameVtbl InPlaceFrameVtbl
= {
1164 InPlaceFrame_QueryInterface
,
1165 InPlaceFrame_AddRef
,
1166 InPlaceFrame_Release
,
1167 InPlaceFrame_GetWindow
,
1168 InPlaceFrame_ContextSensitiveHelp
,
1169 InPlaceFrame_GetBorder
,
1170 InPlaceFrame_RequestBorderSpace
,
1171 InPlaceFrame_SetBorderSpace
,
1172 InPlaceFrame_SetActiveObject
,
1173 InPlaceFrame_InsertMenus
,
1174 InPlaceFrame_SetMenu
,
1175 InPlaceFrame_RemoveMenus
,
1176 InPlaceFrame_SetStatusText
,
1177 InPlaceFrame_EnableModeless
,
1178 InPlaceFrame_TranslateAccelerator
1181 static IOleInPlaceFrame InPlaceFrame
= { &InPlaceFrameVtbl
};
1183 static HRESULT WINAPI
InPlaceSite_QueryInterface(IOleInPlaceSite
*iface
, REFIID riid
, void **ppv
)
1185 return QueryInterface(riid
, ppv
);
1188 static ULONG WINAPI
InPlaceSite_AddRef(IOleInPlaceSite
*iface
)
1193 static ULONG WINAPI
InPlaceSite_Release(IOleInPlaceSite
*iface
)
1198 static HRESULT WINAPI
InPlaceSite_GetWindow(IOleInPlaceSite
*iface
, HWND
*phwnd
)
1200 CHECK_EXPECT(GetWindow
);
1201 ok(phwnd
!= NULL
, "phwnd = NULL\n");
1202 *phwnd
= container_hwnd
;
1206 static HRESULT WINAPI
InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite
*iface
, BOOL fEnterMode
)
1208 ok(0, "unexpected call\n");
1212 static HRESULT WINAPI
InPlaceSite_CanInPlaceActivate(IOleInPlaceSite
*iface
)
1214 CHECK_EXPECT(CanInPlaceActivate
);
1218 static HRESULT WINAPI
InPlaceSite_OnInPlaceActivate(IOleInPlaceSite
*iface
)
1220 CHECK_EXPECT(OnInPlaceActivate
);
1224 static HRESULT WINAPI
InPlaceSite_OnUIActivate(IOleInPlaceSite
*iface
)
1226 CHECK_EXPECT(OnUIActivate
);
1230 static HRESULT WINAPI
InPlaceSite_GetWindowContext(IOleInPlaceSite
*iface
,
1231 IOleInPlaceFrame
**ppFrame
, IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
1232 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
1234 static const RECT rect
= {0,0,500,500};
1236 CHECK_EXPECT(GetWindowContext
);
1238 ok(ppFrame
!= NULL
, "ppFrame = NULL\n");
1240 *ppFrame
= &InPlaceFrame
;
1241 ok(ppDoc
!= NULL
, "ppDoc = NULL\n");
1244 ok(lprcPosRect
!= NULL
, "lprcPosRect = NULL\n");
1246 memcpy(lprcPosRect
, &rect
, sizeof(RECT
));
1247 ok(lprcClipRect
!= NULL
, "lprcClipRect = NULL\n");
1249 memcpy(lprcClipRect
, &rect
, sizeof(RECT
));
1250 ok(lpFrameInfo
!= NULL
, "lpFrameInfo = NULL\n");
1252 lpFrameInfo
->cb
= sizeof(*lpFrameInfo
);
1253 lpFrameInfo
->fMDIApp
= FALSE
;
1254 lpFrameInfo
->hwndFrame
= container_hwnd
;
1255 lpFrameInfo
->haccel
= NULL
;
1256 lpFrameInfo
->cAccelEntries
= 0;
1262 static HRESULT WINAPI
InPlaceSite_Scroll(IOleInPlaceSite
*iface
, SIZE scrollExtant
)
1264 ok(0, "unexpected call\n");
1268 static HRESULT WINAPI
InPlaceSite_OnUIDeactivate(IOleInPlaceSite
*iface
, BOOL fUndoable
)
1270 CHECK_EXPECT(OnUIDeactivate
);
1271 ok(!fUndoable
, "fUndoable = TRUE\n");
1275 static HRESULT WINAPI
InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite
*iface
)
1277 CHECK_EXPECT(OnInPlaceDeactivate
);
1281 static HRESULT WINAPI
InPlaceSite_DiscardUndoState(IOleInPlaceSite
*iface
)
1283 ok(0, "unexpected call\n");
1287 static HRESULT WINAPI
InPlaceSite_DeactivateAndUndo(IOleInPlaceSite
*iface
)
1289 ok(0, "unexpected call\n");
1293 static HRESULT WINAPI
InPlaceSite_OnPosRectChange(IOleInPlaceSite
*iface
, LPCRECT lprcPosRect
)
1295 ok(0, "unexpected call\n");
1299 static const IOleInPlaceSiteVtbl InPlaceSiteVtbl
= {
1300 InPlaceSite_QueryInterface
,
1302 InPlaceSite_Release
,
1303 InPlaceSite_GetWindow
,
1304 InPlaceSite_ContextSensitiveHelp
,
1305 InPlaceSite_CanInPlaceActivate
,
1306 InPlaceSite_OnInPlaceActivate
,
1307 InPlaceSite_OnUIActivate
,
1308 InPlaceSite_GetWindowContext
,
1310 InPlaceSite_OnUIDeactivate
,
1311 InPlaceSite_OnInPlaceDeactivate
,
1312 InPlaceSite_DiscardUndoState
,
1313 InPlaceSite_DeactivateAndUndo
,
1314 InPlaceSite_OnPosRectChange
1317 static IOleInPlaceSite InPlaceSite
= { &InPlaceSiteVtbl
};
1319 static HRESULT WINAPI
ClientSite_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppv
)
1321 return QueryInterface(riid
, ppv
);
1324 static ULONG WINAPI
ClientSite_AddRef(IOleClientSite
*iface
)
1329 static ULONG WINAPI
ClientSite_Release(IOleClientSite
*iface
)
1334 static HRESULT WINAPI
ClientSite_SaveObject(IOleClientSite
*iface
)
1336 ok(0, "unexpected call\n");
1340 static HRESULT WINAPI
ClientSite_GetMoniker(IOleClientSite
*iface
, DWORD dwAsign
, DWORD dwWhichMoniker
,
1343 ok(0, "unexpected call\n");
1347 static HRESULT WINAPI
ClientSite_GetContainer(IOleClientSite
*iface
, IOleContainer
**ppContainer
)
1349 CHECK_EXPECT(GetContainer
);
1350 ok(ppContainer
!= NULL
, "ppContainer = NULL\n");
1351 *ppContainer
= &OleContainer
;
1355 static HRESULT WINAPI
ClientSite_ShowObject(IOleClientSite
*iface
)
1357 ok(0, "unexpected call\n");
1361 static HRESULT WINAPI
ClientSite_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
1363 ok(0, "unexpected call\n");
1367 static HRESULT WINAPI
ClientSite_RequestNewObjectLayout(IOleClientSite
*iface
)
1369 ok(0, "unexpected call\n");
1373 static const IOleClientSiteVtbl ClientSiteVtbl
= {
1374 ClientSite_QueryInterface
,
1377 ClientSite_SaveObject
,
1378 ClientSite_GetMoniker
,
1379 ClientSite_GetContainer
,
1380 ClientSite_ShowObject
,
1381 ClientSite_OnShowWindow
,
1382 ClientSite_RequestNewObjectLayout
1385 static IOleClientSite ClientSite
= { &ClientSiteVtbl
};
1387 static HRESULT WINAPI
DocumentSite_QueryInterface(IOleDocumentSite
*iface
, REFIID riid
, void **ppv
)
1389 return QueryInterface(riid
, ppv
);
1392 static ULONG WINAPI
DocumentSite_AddRef(IOleDocumentSite
*iface
)
1397 static ULONG WINAPI
DocumentSite_Release(IOleDocumentSite
*iface
)
1402 static BOOL call_UIActivate
= TRUE
;
1403 static HRESULT WINAPI
DocumentSite_ActivateMe(IOleDocumentSite
*iface
, IOleDocumentView
*pViewToActivate
)
1405 IOleDocument
*document
;
1408 CHECK_EXPECT(ActivateMe
);
1409 ok(pViewToActivate
!= NULL
, "pViewToActivate = NULL\n");
1411 hres
= IOleDocumentView_QueryInterface(pViewToActivate
, &IID_IOleDocument
, (void**)&document
);
1412 ok(hres
== S_OK
, "could not get IOleDocument: %08x\n", hres
);
1414 if(SUCCEEDED(hres
)) {
1415 hres
= IOleDocument_CreateView(document
, &InPlaceSite
, NULL
, 0, &view
);
1416 ok(hres
== S_OK
, "CreateView failed: %08x\n", hres
);
1418 if(SUCCEEDED(hres
)) {
1419 IOleInPlaceActiveObject
*activeobj
= NULL
;
1420 IOleInPlaceSite
*inplacesite
= NULL
;
1421 HWND tmp_hwnd
= NULL
;
1422 static RECT rect
= {0,0,400,500};
1424 hres
= IOleDocumentView_GetInPlaceSite(view
, &inplacesite
);
1425 ok(hres
== S_OK
, "GetInPlaceSite failed: %08x\n", hres
);
1426 ok(inplacesite
== &InPlaceSite
, "inplacesite=%p, expected %p\n",
1427 inplacesite
, &InPlaceSite
);
1429 hres
= IOleDocumentView_SetInPlaceSite(view
, &InPlaceSite
);
1430 ok(hres
== S_OK
, "SetInPlaceSite failed: %08x\n", hres
);
1432 hres
= IOleDocumentView_GetInPlaceSite(view
, &inplacesite
);
1433 ok(hres
== S_OK
, "GetInPlaceSite failed: %08x\n", hres
);
1434 ok(inplacesite
== &InPlaceSite
, "inplacesite=%p, expected %p\n",
1435 inplacesite
, &InPlaceSite
);
1437 hres
= IOleDocumentView_QueryInterface(view
, &IID_IOleInPlaceActiveObject
, (void**)&activeobj
);
1438 ok(hres
== S_OK
, "Could not get IOleInPlaceActiveObject: %08x\n", hres
);
1441 IOleInPlaceActiveObject_GetWindow(activeobj
, &hwnd
);
1442 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1443 ok(hwnd
== NULL
, "hwnd=%p, expeted NULL\n", hwnd
);
1446 if(call_UIActivate
) {
1447 SET_EXPECT(CanInPlaceActivate
);
1448 SET_EXPECT(GetWindowContext
);
1449 SET_EXPECT(GetWindow
);
1450 SET_EXPECT(OnInPlaceActivate
);
1451 SET_EXPECT(SetStatusText
);
1452 SET_EXPECT(Exec_SETPROGRESSMAX
);
1453 SET_EXPECT(Exec_SETPROGRESSPOS
);
1454 SET_EXPECT(OnUIActivate
);
1455 SET_EXPECT(SetActiveObject
);
1457 expect_SetActiveObject_active
= TRUE
;
1458 expect_status_text
= NULL
;
1460 hres
= IOleDocumentView_UIActivate(view
, TRUE
);
1463 trace("UIActivate failed: %08x\n", hres
);
1466 ok(hres
== S_OK
, "UIActivate failed: %08x\n", hres
);
1468 CHECK_CALLED(CanInPlaceActivate
);
1469 CHECK_CALLED(GetWindowContext
);
1470 CHECK_CALLED(GetWindow
);
1471 CHECK_CALLED(OnInPlaceActivate
);
1472 CHECK_CALLED(SetStatusText
);
1473 CHECK_CALLED(Exec_SETPROGRESSMAX
);
1474 CHECK_CALLED(Exec_SETPROGRESSPOS
);
1475 CHECK_CALLED(OnUIActivate
);
1476 CHECK_CALLED(SetActiveObject
);
1477 CHECK_CALLED(ShowUI
);
1480 hres
= IOleInPlaceActiveObject_GetWindow(activeobj
, &hwnd
);
1481 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1482 ok(hwnd
!= NULL
, "hwnd == NULL\n");
1484 ok(hwnd
== last_hwnd
, "hwnd != last_hwnd\n");
1487 hres
= IOleDocumentView_UIActivate(view
, TRUE
);
1488 ok(hres
== S_OK
, "UIActivate failed: %08x\n", hres
);
1491 hres
= IOleInPlaceActiveObject_GetWindow(activeobj
, &tmp_hwnd
);
1492 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1493 ok(tmp_hwnd
== hwnd
, "tmp_hwnd=%p, expected %p\n", tmp_hwnd
, hwnd
);
1497 hres
= IOleDocumentView_SetRect(view
, &rect
);
1498 ok(hres
== S_OK
, "SetRect failed: %08x\n", hres
);
1500 if(call_UIActivate
) {
1501 hres
= IOleDocumentView_Show(view
, TRUE
);
1502 ok(hres
== S_OK
, "Show failed: %08x\n", hres
);
1504 SET_EXPECT(CanInPlaceActivate
);
1505 SET_EXPECT(GetWindowContext
);
1506 SET_EXPECT(GetWindow
);
1507 SET_EXPECT(OnInPlaceActivate
);
1508 SET_EXPECT(SetStatusText
);
1509 SET_EXPECT(Exec_SETPROGRESSMAX
);
1510 SET_EXPECT(Exec_SETPROGRESSPOS
);
1511 SET_EXPECT(OnUIActivate
);
1512 expect_status_text
= (load_state
== LD_COMPLETE
? (LPCOLESTR
)0xdeadbeef : NULL
);
1514 hres
= IOleDocumentView_Show(view
, TRUE
);
1515 ok(hres
== S_OK
, "Show failed: %08x\n", hres
);
1517 CHECK_CALLED(CanInPlaceActivate
);
1518 CHECK_CALLED(GetWindowContext
);
1519 CHECK_CALLED(GetWindow
);
1520 CHECK_CALLED(OnInPlaceActivate
);
1521 CHECK_CALLED(SetStatusText
);
1522 CHECK_CALLED(Exec_SETPROGRESSMAX
);
1523 CHECK_CALLED(Exec_SETPROGRESSPOS
);
1526 hres
= IOleInPlaceActiveObject_GetWindow(activeobj
, &hwnd
);
1527 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
1528 ok(hwnd
!= NULL
, "hwnd == NULL\n");
1530 ok(hwnd
== last_hwnd
, "hwnd != last_hwnd\n");
1534 test_timer(EXPECT_UPDATEUI
| ((load_state
== LD_LOADING
) ? EXPECT_SETTITLE
: 0));
1537 IOleInPlaceActiveObject_Release(activeobj
);
1540 IOleDocument_Release(document
);
1546 static const IOleDocumentSiteVtbl DocumentSiteVtbl
= {
1547 DocumentSite_QueryInterface
,
1548 DocumentSite_AddRef
,
1549 DocumentSite_Release
,
1550 DocumentSite_ActivateMe
1553 static IOleDocumentSite DocumentSite
= { &DocumentSiteVtbl
};
1555 static HRESULT WINAPI
DocHostUIHandler_QueryInterface(IDocHostUIHandler2
*iface
, REFIID riid
, void **ppv
)
1557 return QueryInterface(riid
, ppv
);
1560 static ULONG WINAPI
DocHostUIHandler_AddRef(IDocHostUIHandler2
*iface
)
1565 static ULONG WINAPI
DocHostUIHandler_Release(IDocHostUIHandler2
*iface
)
1570 static HRESULT WINAPI
DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2
*iface
, DWORD dwID
, POINT
*ppt
,
1571 IUnknown
*pcmdtReserved
, IDispatch
*pdicpReserved
)
1573 ok(0, "unexpected call\n");
1577 static HRESULT WINAPI
DocHostUIHandler_GetHostInfo(IDocHostUIHandler2
*iface
, DOCHOSTUIINFO
*pInfo
)
1579 CHECK_EXPECT(GetHostInfo
);
1580 ok(pInfo
!= NULL
, "pInfo=NULL\n");
1582 ok(pInfo
->cbSize
== sizeof(DOCHOSTUIINFO
), "pInfo->cbSize=%u\n", pInfo
->cbSize
);
1583 ok(!pInfo
->dwFlags
, "pInfo->dwFlags=%08x, expected 0\n", pInfo
->dwFlags
);
1584 pInfo
->dwFlags
= DOCHOSTUIFLAG_DISABLE_HELP_MENU
| DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE
1585 | DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY
| DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION
1586 | DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION
;
1587 ok(!pInfo
->dwDoubleClick
, "pInfo->dwDoubleClick=%08x, expected 0\n", pInfo
->dwDoubleClick
);
1588 ok(!pInfo
->pchHostCss
, "pInfo->pchHostCss=%p, expected NULL\n", pInfo
->pchHostCss
);
1589 ok(!pInfo
->pchHostNS
, "pInfo->pchhostNS=%p, expected NULL\n", pInfo
->pchHostNS
);
1594 static HRESULT WINAPI
DocHostUIHandler_ShowUI(IDocHostUIHandler2
*iface
, DWORD dwID
,
1595 IOleInPlaceActiveObject
*pActiveObject
, IOleCommandTarget
*pCommandTarget
,
1596 IOleInPlaceFrame
*pFrame
, IOleInPlaceUIWindow
*pDoc
)
1598 CHECK_EXPECT(ShowUI
);
1600 ok(dwID
== DOCHOSTUITYPE_BROWSE
, "dwID=%d, expected DOCHOSTUITYPE_BROWSE\n", dwID
);
1601 ok(pActiveObject
!= NULL
, "pActiveObject = NULL\n");
1602 ok(pCommandTarget
!= NULL
, "pCommandTarget = NULL\n");
1603 ok(pFrame
== &InPlaceFrame
, "pFrame=%p, expected %p\n", pFrame
, &InPlaceFrame
);
1604 ok(pDoc
== NULL
, "pDoc=%p, expected NULL\n", pDoc
);
1609 static HRESULT WINAPI
DocHostUIHandler_HideUI(IDocHostUIHandler2
*iface
)
1611 CHECK_EXPECT(HideUI
);
1615 static HRESULT WINAPI
DocHostUIHandler_UpdateUI(IDocHostUIHandler2
*iface
)
1617 CHECK_EXPECT(UpdateUI
);
1621 static HRESULT WINAPI
DocHostUIHandler_EnableModeless(IDocHostUIHandler2
*iface
, BOOL fEnable
)
1623 ok(0, "unexpected call\n");
1627 static HRESULT WINAPI
DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1629 ok(0, "unexpected call\n");
1633 static BOOL expect_OnFrameWindowActivate_fActivate
;
1634 static HRESULT WINAPI
DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
*iface
, BOOL fActivate
)
1636 CHECK_EXPECT2(OnFrameWindowActivate
);
1637 ok(fActivate
== expect_OnFrameWindowActivate_fActivate
, "fActivate=%x\n", fActivate
);
1641 static HRESULT WINAPI
DocHostUIHandler_ResizeBorder(IDocHostUIHandler2
*iface
, LPCRECT prcBorder
,
1642 IOleInPlaceUIWindow
*pUIWindow
, BOOL fRameWindow
)
1644 ok(0, "unexpected call\n");
1648 static HRESULT WINAPI
DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2
*iface
, LPMSG lpMsg
,
1649 const GUID
*pguidCmdGroup
, DWORD nCmdID
)
1651 ok(0, "unexpected call\n");
1655 static HRESULT WINAPI
DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2
*iface
,
1656 LPOLESTR
*pchKey
, DWORD dw
)
1658 CHECK_EXPECT(GetOptionKeyPath
);
1659 ok(pchKey
!= NULL
, "pchKey = NULL\n");
1660 ok(!dw
, "dw=%d, expected 0\n", dw
);
1662 ok(!*pchKey
, "*pchKey=%p, expected NULL\n", *pchKey
);
1666 static HRESULT WINAPI
DocHostUIHandler_GetDropTarget(IDocHostUIHandler2
*iface
,
1667 IDropTarget
*pDropTarget
, IDropTarget
**ppDropTarget
)
1669 CHECK_EXPECT(GetDropTarget
);
1674 static HRESULT WINAPI
DocHostUIHandler_GetExternal(IDocHostUIHandler2
*iface
, IDispatch
**ppDispatch
)
1676 ok(0, "unexpected call\n");
1680 static HRESULT WINAPI
DocHostUIHandler_TranslateUrl(IDocHostUIHandler2
*iface
, DWORD dwTranslate
,
1681 OLECHAR
*pchURLIn
, OLECHAR
**ppchURLOut
)
1683 ok(0, "unexpected call\n");
1687 static HRESULT WINAPI
DocHostUIHandler_FilterDataObject(IDocHostUIHandler2
*iface
, IDataObject
*pDO
,
1688 IDataObject
**ppPORet
)
1690 ok(0, "unexpected call\n");
1694 static HRESULT WINAPI
DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2
*iface
,
1695 LPOLESTR
*pchKey
, DWORD dw
)
1697 CHECK_EXPECT(GetOverrideKeyPath
);
1698 ok(pchKey
!= NULL
, "pchKey = NULL\n");
1700 ok(!*pchKey
, "*pchKey=%p, expected NULL\n", *pchKey
);
1701 ok(!dw
, "dw=%d, xepected 0\n", dw
);
1705 static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl
= {
1706 DocHostUIHandler_QueryInterface
,
1707 DocHostUIHandler_AddRef
,
1708 DocHostUIHandler_Release
,
1709 DocHostUIHandler_ShowContextMenu
,
1710 DocHostUIHandler_GetHostInfo
,
1711 DocHostUIHandler_ShowUI
,
1712 DocHostUIHandler_HideUI
,
1713 DocHostUIHandler_UpdateUI
,
1714 DocHostUIHandler_EnableModeless
,
1715 DocHostUIHandler_OnDocWindowActivate
,
1716 DocHostUIHandler_OnFrameWindowActivate
,
1717 DocHostUIHandler_ResizeBorder
,
1718 DocHostUIHandler_TranslateAccelerator
,
1719 DocHostUIHandler_GetOptionKeyPath
,
1720 DocHostUIHandler_GetDropTarget
,
1721 DocHostUIHandler_GetExternal
,
1722 DocHostUIHandler_TranslateUrl
,
1723 DocHostUIHandler_FilterDataObject
,
1724 DocHostUIHandler_GetOverrideKeyPath
1727 static IDocHostUIHandler2 DocHostUIHandler
= { &DocHostUIHandlerVtbl
};
1729 static HRESULT WINAPI
OleCommandTarget_QueryInterface(IOleCommandTarget
*iface
,
1730 REFIID riid
, void **ppv
)
1732 return QueryInterface(riid
, ppv
);
1735 static ULONG WINAPI
OleCommandTarget_AddRef(IOleCommandTarget
*iface
)
1740 static ULONG WINAPI
OleCommandTarget_Release(IOleCommandTarget
*iface
)
1745 static HRESULT WINAPI
OleCommandTarget_QueryStatus(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
1746 ULONG cCmds
, OLECMD prgCmds
[], OLECMDTEXT
*pCmdText
)
1748 ok(!pguidCmdGroup
, "pguidCmdGroup != MULL\n");
1749 ok(cCmds
== 1, "cCmds=%d, expected 1\n", cCmds
);
1750 ok(!pCmdText
, "pCmdText != NULL\n");
1752 switch(prgCmds
[0].cmdID
) {
1753 case OLECMDID_SETPROGRESSTEXT
:
1754 CHECK_EXPECT(QueryStatus_SETPROGRESSTEXT
);
1755 prgCmds
[0].cmdf
= OLECMDF_ENABLED
;
1758 CHECK_EXPECT(QueryStatus_OPEN
);
1759 prgCmds
[0].cmdf
= 0;
1762 CHECK_EXPECT(QueryStatus_NEW
);
1763 prgCmds
[0].cmdf
= 0;
1766 ok(0, "unexpected command %d\n", prgCmds
[0].cmdID
);
1772 static HRESULT WINAPI
OleCommandTarget_Exec(IOleCommandTarget
*iface
, const GUID
*pguidCmdGroup
,
1773 DWORD nCmdID
, DWORD nCmdexecopt
, VARIANT
*pvaIn
, VARIANT
*pvaOut
)
1775 test_readyState(NULL
);
1777 if(!pguidCmdGroup
) {
1779 case OLECMDID_SETPROGRESSMAX
:
1780 CHECK_EXPECT2(Exec_SETPROGRESSMAX
);
1781 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1782 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
1784 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
1785 if(load_state
== LD_NO
)
1786 ok(V_I4(pvaIn
) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn
));
1788 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
1790 case OLECMDID_SETPROGRESSPOS
:
1791 CHECK_EXPECT2(Exec_SETPROGRESSPOS
);
1792 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1793 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
1795 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
1796 if(load_state
== LD_NO
)
1797 ok(V_I4(pvaIn
) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn
));
1799 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
1801 case OLECMDID_HTTPEQUIV_DONE
:
1802 CHECK_EXPECT(Exec_HTTPEQUIV_DONE
);
1803 ok(nCmdexecopt
== 0, "nCmdexecopts=%08x\n", nCmdexecopt
);
1804 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
1805 ok(pvaIn
== NULL
, "pvaIn=%p\n", pvaIn
);
1806 load_state
= LD_COMPLETE
;
1808 case OLECMDID_SETDOWNLOADSTATE
:
1809 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1810 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
1811 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
1812 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d\n", V_VT(pvaIn
));
1814 switch(V_I4(pvaIn
)) {
1816 CHECK_EXPECT(Exec_SETDOWNLOADSTATE_0
);
1817 load_state
= LD_INTERACTIVE
;
1820 CHECK_EXPECT(Exec_SETDOWNLOADSTATE_1
);
1823 ok(0, "unexpevted V_I4(pvaIn)=%d\n", V_I4(pvaIn
));
1827 case OLECMDID_UPDATECOMMANDS
:
1828 CHECK_EXPECT(Exec_UPDATECOMMANDS
);
1829 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1830 ok(pvaIn
== NULL
, "pvaIn=%p\n", pvaIn
);
1831 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
1833 case OLECMDID_SETTITLE
:
1834 CHECK_EXPECT2(Exec_SETTITLE
);
1835 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1836 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
1837 ok(pvaOut
== NULL
, "pvaOut=%p\n", pvaOut
);
1838 ok(V_VT(pvaIn
) == VT_BSTR
, "V_VT(pvaIn)=%d\n", V_VT(pvaIn
));
1839 ok(V_BSTR(pvaIn
) != NULL
, "V_BSTR(pvaIn) == NULL\n"); /* TODO */
1841 case OLECMDID_HTTPEQUIV
:
1842 CHECK_EXPECT2(Exec_HTTPEQUIV
);
1843 ok(nCmdexecopt
== OLECMDEXECOPT_DONTPROMPTUSER
, "nCmdexecopts=%08x\n", nCmdexecopt
);
1847 ok(0, "unexpected command %d\n", nCmdID
);
1852 if(IsEqualGUID(&CGID_ShellDocView
, pguidCmdGroup
)) {
1853 ok(nCmdexecopt
== 0, "nCmdexecopts=%08x\n", nCmdexecopt
);
1857 CHECK_EXPECT2(Exec_ShellDocView_37
);
1859 if(load_from_stream
)
1860 test_GetCurMoniker(doc_unk
, NULL
, about_blank_url
);
1862 test_GetCurMoniker(doc_unk
, &Moniker
, NULL
);
1864 ok(pvaOut
== NULL
, "pvaOut=%p, expected NULL\n", pvaOut
);
1865 ok(pvaIn
!= NULL
, "pvaIn == NULL\n");
1867 ok(V_VT(pvaIn
) == VT_I4
, "V_VT(pvaIn)=%d, expected VT_I4\n", V_VT(pvaIn
));
1868 ok(V_I4(pvaIn
) == 0, "V_I4(pvaIn)=%d, expected 0\n", V_I4(pvaIn
));
1872 ok(0, "unexpected command %d\n", nCmdID
);
1877 if(IsEqualGUID(&CGID_MSHTML
, pguidCmdGroup
)) {
1878 ok(nCmdexecopt
== 0, "nCmdexecopts=%08x\n", nCmdexecopt
);
1881 case IDM_PARSECOMPLETE
:
1882 CHECK_EXPECT(Exec_MSHTML_PARSECOMPLETE
);
1883 ok(pvaIn
== NULL
, "pvaIn != NULL\n");
1884 ok(pvaOut
== NULL
, "pvaOut != NULL\n");
1887 ok(0, "unexpected command %d\n", nCmdID
);
1891 if(IsEqualGUID(&CGID_DocHostCmdPriv
, pguidCmdGroup
))
1892 return E_FAIL
; /* TODO */
1894 ok(0, "unexpected call\n");
1898 static IOleCommandTargetVtbl OleCommandTargetVtbl
= {
1899 OleCommandTarget_QueryInterface
,
1900 OleCommandTarget_AddRef
,
1901 OleCommandTarget_Release
,
1902 OleCommandTarget_QueryStatus
,
1903 OleCommandTarget_Exec
1906 static IOleCommandTarget OleCommandTarget
= { &OleCommandTargetVtbl
};
1908 static HRESULT WINAPI
Dispatch_QueryInterface(IDispatch
*iface
, REFIID riid
, void **ppv
)
1910 return QueryInterface(riid
, ppv
);
1913 static ULONG WINAPI
Dispatch_AddRef(IDispatch
*iface
)
1918 static ULONG WINAPI
Dispatch_Release(IDispatch
*iface
)
1923 static HRESULT WINAPI
Dispatch_GetTypeInfoCount(IDispatch
*iface
, UINT
*pctinfo
)
1925 ok(0, "unexpected call\n");
1929 static HRESULT WINAPI
Dispatch_GetTypeInfo(IDispatch
*iface
, UINT iTInfo
, LCID lcid
,
1930 ITypeInfo
**ppTInfo
)
1932 ok(0, "unexpected call\n");
1936 static HRESULT WINAPI
Dispatch_GetIDsOfNames(IDispatch
*iface
, REFIID riid
, LPOLESTR
*rgszNames
,
1937 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1939 ok(0, "unexpected call\n");
1943 static HRESULT WINAPI
Dispatch_Invoke(IDispatch
*iface
, DISPID dispIdMember
, REFIID riid
,
1944 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
1945 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1947 ok(IsEqualGUID(&IID_NULL
, riid
), "riid != IID_NULL\n");
1948 ok(pDispParams
!= NULL
, "pDispParams == NULL\n");
1949 ok(pExcepInfo
== NULL
, "pExcepInfo=%p, expected NULL\n", pExcepInfo
);
1950 ok(puArgErr
!= NULL
, "puArgErr == NULL\n");
1951 ok(V_VT(pVarResult
) == 0, "V_VT(pVarResult)=%d, expected 0\n", V_VT(pVarResult
));
1952 ok(wFlags
== DISPATCH_PROPERTYGET
, "wFlags=%08x, expected DISPATCH_PROPERTYGET\n", wFlags
);
1953 test_readyState(NULL
);
1955 switch(dispIdMember
) {
1956 case DISPID_AMBIENT_USERMODE
:
1957 CHECK_EXPECT2(Invoke_AMBIENT_USERMODE
);
1958 V_VT(pVarResult
) = VT_BOOL
;
1959 V_BOOL(pVarResult
) = VARIANT_TRUE
;
1961 case DISPID_AMBIENT_DLCONTROL
:
1962 CHECK_EXPECT2(Invoke_AMBIENT_DLCONTROL
);
1964 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
:
1965 CHECK_EXPECT2(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
1967 case DISPID_AMBIENT_SILENT
:
1968 CHECK_EXPECT2(Invoke_AMBIENT_SILENT
);
1969 V_VT(pVarResult
) = VT_BOOL
;
1970 V_BOOL(pVarResult
) = VARIANT_FALSE
;
1972 case DISPID_AMBIENT_USERAGENT
:
1973 CHECK_EXPECT(Invoke_AMBIENT_USERAGENT
);
1975 case DISPID_AMBIENT_PALETTE
:
1976 CHECK_EXPECT(Invoke_AMBIENT_PALETTE
);
1980 ok(0, "unexpected dispid %d\n", dispIdMember
);
1984 static IDispatchVtbl DispatchVtbl
= {
1985 Dispatch_QueryInterface
,
1988 Dispatch_GetTypeInfoCount
,
1989 Dispatch_GetTypeInfo
,
1990 Dispatch_GetIDsOfNames
,
1994 static IDispatch Dispatch
= { &DispatchVtbl
};
1996 static HRESULT WINAPI
ServiceProvider_QueryInterface(IServiceProvider
*iface
,
1997 REFIID riid
, void **ppv
)
1999 return QueryInterface(riid
, ppv
);
2002 static ULONG WINAPI
ServiceProvider_AddRef(IServiceProvider
*iface
)
2007 static ULONG WINAPI
ServiceProvider_Release(IServiceProvider
*iface
)
2012 static HRESULT WINAPI
ServiceProvider_QueryService(IServiceProvider
*iface
, REFGUID guidService
,
2013 REFIID riid
, void **ppv
)
2016 * Services used by HTMLDocument:
2019 * IInternetSecurityManager
2021 * {D5F78C80-5252-11CF-90FA-00AA0042106E}
2024 * {3050F312-98B5-11CF-BB82-00AA00BDCE0B}
2025 * {53A2D5B1-D2FC-11D0-84E0-006097C9987D}
2026 * {AD7F6C62-F6BD-11D2-959B-006097C553C8}
2028 * {6D12FE80-7911-11CF-9534-0000C05BAE0B}
2029 * IElementBehaviorFactory
2030 * {3050F429-98B5-11CF-BB82-00AA00BDCE0B}
2040 if(IsEqualGUID(&IID_IHlinkFrame
, guidService
)) {
2041 ok(IsEqualGUID(&IID_IHlinkFrame
, riid
), "unexpected riid\n");
2046 return E_NOINTERFACE
;
2049 static const IServiceProviderVtbl ServiceProviderVtbl
= {
2050 ServiceProvider_QueryInterface
,
2051 ServiceProvider_AddRef
,
2052 ServiceProvider_Release
,
2053 ServiceProvider_QueryService
2056 static IServiceProvider ServiceProvider
= { &ServiceProviderVtbl
};
2058 static HRESULT
QueryInterface(REFIID riid
, void **ppv
)
2062 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IOleClientSite
, riid
))
2064 else if(IsEqualGUID(&IID_IOleDocumentSite
, riid
))
2065 *ppv
= &DocumentSite
;
2066 else if(IsEqualGUID(&IID_IDocHostUIHandler
, riid
) || IsEqualGUID(&IID_IDocHostUIHandler2
, riid
))
2067 *ppv
= &DocHostUIHandler
;
2068 else if(IsEqualGUID(&IID_IOleContainer
, riid
))
2069 *ppv
= &OleContainer
;
2070 else if(IsEqualGUID(&IID_IOleWindow
, riid
) || IsEqualGUID(&IID_IOleInPlaceSite
, riid
))
2071 *ppv
= &InPlaceSite
;
2072 else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
) || IsEqualGUID(&IID_IOleInPlaceFrame
, riid
))
2073 *ppv
= &InPlaceFrame
;
2074 else if(IsEqualGUID(&IID_IOleCommandTarget
, riid
))
2075 *ppv
= &OleCommandTarget
;
2076 else if(IsEqualGUID(&IID_IDispatch
, riid
))
2078 else if(IsEqualGUID(&IID_IServiceProvider
, riid
))
2079 *ppv
= &ServiceProvider
;
2083 * {D48A6EC6-6A4A-11CF-94A7-444553540000}
2084 * {7BB0B520-B1A7-11D2-BB23-00C04F79ABCD}
2085 * {000670BA-0000-0000-C000-000000000046}
2090 return E_NOINTERFACE
;
2093 static LRESULT WINAPI
wnd_proc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
2095 return DefWindowProc(hwnd
, msg
, wParam
, lParam
);
2098 static void test_readyState(IUnknown
*unk
)
2100 IHTMLDocument2
*htmldoc
;
2104 static const WCHAR wszUninitialized
[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
2105 static const WCHAR wszLoading
[] = {'l','o','a','d','i','n','g',0};
2106 static const WCHAR wszInteractive
[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
2107 static const WCHAR wszComplete
[] = {'c','o','m','p','l','e','t','e',0};
2109 static const LPCWSTR expected_state
[] = {
2120 hres
= IUnknown_QueryInterface(unk
, &IID_IHTMLDocument2
, (void**)&htmldoc
);
2121 ok(hres
== S_OK
, "QueryInterface(IID_IHTMLDocument2) failed: %08x\n", hres
);
2125 hres
= IHTMLDocument2_get_readyState(htmldoc
, NULL
);
2126 ok(hres
== E_POINTER
, "get_readyState failed: %08x, expected\n", hres
);
2128 hres
= IHTMLDocument2_get_readyState(htmldoc
, &state
);
2129 ok(hres
== S_OK
, "get_ReadyState failed: %08x\n", hres
);
2130 ok(!lstrcmpW(state
, expected_state
[load_state
]), "unexpected state, expected %d\n", load_state
);
2132 IHTMLDocument_Release(htmldoc
);
2135 static void test_ConnectionPoint(IConnectionPointContainer
*container
, REFIID riid
)
2137 IConnectionPointContainer
*tmp_container
= NULL
;
2138 IConnectionPoint
*cp
;
2142 hres
= IConnectionPointContainer_FindConnectionPoint(container
, riid
, &cp
);
2143 ok(hres
== S_OK
, "FindConnectionPoint failed: %08x\n", hres
);
2147 hres
= IConnectionPoint_GetConnectionInterface(cp
, &iid
);
2148 ok(hres
== S_OK
, "GetConnectionInterface failed: %08x\n", hres
);
2149 ok(IsEqualGUID(riid
, &iid
), "wrong iid\n");
2151 hres
= IConnectionPoint_GetConnectionInterface(cp
, NULL
);
2152 ok(hres
== E_POINTER
, "GetConnectionInterface failed: %08x, expected E_POINTER\n", hres
);
2154 hres
= IConnectionPoint_GetConnectionPointContainer(cp
, &tmp_container
);
2155 ok(hres
== S_OK
, "GetConnectionPointContainer failed: %08x\n", hres
);
2156 ok(tmp_container
== container
, "container != tmp_container\n");
2158 IConnectionPointContainer_Release(tmp_container
);
2160 hres
= IConnectionPoint_GetConnectionPointContainer(cp
, NULL
);
2161 ok(hres
== E_POINTER
, "GetConnectionPointContainer failed: %08x, expected E_POINTER\n", hres
);
2163 if(IsEqualGUID(&IID_IPropertyNotifySink
, riid
)) {
2166 hres
= IConnectionPoint_Advise(cp
, (IUnknown
*)&PropertyNotifySink
, &cookie
);
2167 ok(hres
== S_OK
, "Advise failed: %08x\n", hres
);
2170 IConnectionPoint_Release(cp
);
2173 static void test_ConnectionPointContainer(IUnknown
*unk
)
2175 IConnectionPointContainer
*container
;
2178 hres
= IUnknown_QueryInterface(unk
, &IID_IConnectionPointContainer
, (void**)&container
);
2179 ok(hres
== S_OK
, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres
);
2183 test_ConnectionPoint(container
, &IID_IPropertyNotifySink
);
2184 test_ConnectionPoint(container
, &DIID_HTMLDocumentEvents
);
2185 test_ConnectionPoint(container
, &DIID_HTMLDocumentEvents2
);
2187 IConnectionPointContainer_Release(container
);
2190 static void test_GetCurMoniker(IUnknown
*unk
, IMoniker
*exmon
, LPCWSTR exurl
)
2192 IHTMLDocument2
*doc
;
2193 IPersistMoniker
*permon
;
2194 IMoniker
*mon
= (void*)0xdeadbeef;
2195 BSTR doc_url
= (void*)0xdeadbeef;
2198 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistMoniker
, (void**)&permon
);
2199 ok(hres
== S_OK
, "QueryInterface(IID_IPersistMoniker) failed: %08x\n", hres
);
2203 hres
= IUnknown_QueryInterface(unk
, &IID_IHTMLDocument2
, (void**)&doc
);
2204 ok(hres
== S_OK
, "QueryInterface(IID_IHTMLDocument2) failed: %08x\n", hres
);
2206 hres
= IHTMLDocument2_get_URL(doc
, &doc_url
);
2207 ok(hres
== S_OK
, "get_URL failed: %08x\n", hres
);
2209 hres
= IPersistMoniker_GetCurMoniker(permon
, &mon
);
2210 IPersistMoniker_Release(permon
);
2214 BOOL exb
= expect_GetDisplayName
;
2215 BOOL clb
= called_GetDisplayName
;
2217 ok(hres
== S_OK
, "GetCurrentMoniker failed: %08x\n", hres
);
2218 ok(mon
== exmon
, "mon(%p) != exmon(%p)\n", mon
, exmon
);
2220 SET_EXPECT(GetDisplayName
);
2221 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &url
);
2222 ok(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
2223 CHECK_CALLED(GetDisplayName
);
2224 expect_GetDisplayName
= exb
;
2225 called_GetDisplayName
= clb
;
2228 ok(!lstrcmpW(url
, doc_url
), "url != doc_url\n");
2232 ok(hres
== S_OK
, "GetCurrentMoniker failed: %08x\n", hres
);
2234 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &url
);
2235 ok(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
2237 ok(!lstrcmpW(url
, exurl
), "unexpected url\n");
2238 ok(!lstrcmpW(url
, doc_url
), "url != doc_url\n");
2242 ok(hres
== E_UNEXPECTED
,
2243 "GetCurrentMoniker failed: %08x, expected E_UNEXPECTED\n", hres
);
2244 ok(mon
== (IMoniker
*)0xdeadbeef, "mon=%p\n", mon
);
2245 ok(!lstrcmpW(doc_url
, about_blank_url
), "doc_url is not about:blank\n");
2248 SysFreeString(doc_url
);
2249 IHTMLDocument_Release(doc
);
2250 if(mon
&& mon
!= (void*)0xdeadbeef)
2251 IMoniker_Release(mon
);
2254 static void test_Load(IPersistMoniker
*persist
)
2258 WCHAR sz_html_clientsite_objectparam
[MAX_PATH
];
2260 lstrcpyW(sz_html_clientsite_objectparam
, SZ_HTML_CLIENTSITE_OBJECTPARAM
);
2262 test_readyState((IUnknown
*)persist
);
2264 CreateBindCtx(0, &bind
);
2265 IBindCtx_RegisterObjectParam(bind
, sz_html_clientsite_objectparam
,
2266 (IUnknown
*)&ClientSite
);
2268 SET_EXPECT(GetDisplayName
);
2269 if(!set_clientsite
) {
2270 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
2271 SET_EXPECT(GetHostInfo
);
2272 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2273 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2274 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2275 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
2276 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
2277 SET_EXPECT(GetOptionKeyPath
);
2278 SET_EXPECT(GetOverrideKeyPath
);
2279 SET_EXPECT(GetWindow
);
2280 SET_EXPECT(QueryStatus_SETPROGRESSTEXT
);
2281 SET_EXPECT(Exec_SETPROGRESSMAX
);
2282 SET_EXPECT(Exec_SETPROGRESSPOS
);
2283 SET_EXPECT(Exec_ShellDocView_37
);
2285 if(!container_locked
) {
2286 SET_EXPECT(GetContainer
);
2287 SET_EXPECT(LockContainer
);
2289 SET_EXPECT(OnChanged_READYSTATE
);
2290 SET_EXPECT(BindToStorage
);
2291 if(set_clientsite
) {
2292 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2293 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2294 SET_EXPECT(Exec_ShellDocView_37
);
2296 expect_LockContainer_fLock
= TRUE
;
2297 readystate_set_loading
= TRUE
;
2299 hres
= IPersistMoniker_Load(persist
, FALSE
, &Moniker
, bind
, 0x12);
2300 ok(hres
== S_OK
, "Load failed: %08x\n", hres
);
2302 CHECK_CALLED(GetDisplayName
);
2303 if(!set_clientsite
) {
2304 CHECK_CALLED(Invoke_AMBIENT_USERMODE
);
2305 CHECK_CALLED(GetHostInfo
);
2306 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2307 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2308 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2309 CHECK_CALLED(Invoke_AMBIENT_USERAGENT
);
2310 CHECK_CALLED(Invoke_AMBIENT_PALETTE
);
2311 CHECK_CALLED(GetOptionKeyPath
);
2312 CHECK_CALLED(GetOverrideKeyPath
);
2313 CHECK_CALLED(GetWindow
);
2314 CHECK_CALLED(QueryStatus_SETPROGRESSTEXT
);
2315 CHECK_CALLED(Exec_SETPROGRESSMAX
);
2316 CHECK_CALLED(Exec_SETPROGRESSPOS
);
2317 CHECK_CALLED(Exec_ShellDocView_37
);
2319 if(!container_locked
) {
2320 CHECK_CALLED(GetContainer
);
2321 CHECK_CALLED(LockContainer
);
2322 container_locked
= TRUE
;
2324 CHECK_CALLED(OnChanged_READYSTATE
);
2325 CHECK_CALLED(BindToStorage
);
2326 if(set_clientsite
) {
2327 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2328 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2329 CHECK_CALLED(Exec_ShellDocView_37
);
2332 set_clientsite
= container_locked
= TRUE
;
2334 test_GetCurMoniker((IUnknown
*)persist
, &Moniker
, NULL
);
2336 IBindCtx_Release(bind
);
2338 test_readyState((IUnknown
*)persist
);
2341 static void test_download(BOOL verb_done
, BOOL css_dwl
)
2346 hwnd
= FindWindowA("Internet Explorer_Hidden", NULL
);
2347 ok(hwnd
!= NULL
, "Could not find hidden window\n");
2349 test_readyState(NULL
);
2352 SET_EXPECT(Exec_SETPROGRESSMAX
);
2353 if(!load_from_stream
)
2354 SET_EXPECT(GetHostInfo
);
2356 SET_EXPECT(SetStatusText
);
2357 SET_EXPECT(Exec_SETDOWNLOADSTATE_1
);
2358 SET_EXPECT(GetDropTarget
);
2360 SET_EXPECT(CreateInstance
);
2362 SET_EXPECT(LockRequest
);
2363 SET_EXPECT(Terminate
);
2364 SET_EXPECT(Protocol_Read
);
2365 SET_EXPECT(UnlockRequest
);
2367 SET_EXPECT(OnChanged_1005
);
2368 SET_EXPECT(OnChanged_READYSTATE
);
2369 SET_EXPECT(Exec_SETPROGRESSPOS
);
2370 SET_EXPECT(Exec_SETDOWNLOADSTATE_0
);
2371 SET_EXPECT(Exec_MSHTML_PARSECOMPLETE
);
2372 SET_EXPECT(Exec_HTTPEQUIV_DONE
);
2373 expect_status_text
= (LPWSTR
)0xdeadbeef; /* TODO */
2375 while(!called_Exec_HTTPEQUIV_DONE
&& GetMessage(&msg
, NULL
, 0, 0)) {
2376 TranslateMessage(&msg
);
2377 DispatchMessage(&msg
);
2381 CHECK_CALLED(Exec_SETPROGRESSMAX
);
2382 if(!load_from_stream
)
2383 CHECK_CALLED(GetHostInfo
);
2385 CHECK_CALLED(SetStatusText
);
2386 CHECK_CALLED(Exec_SETDOWNLOADSTATE_1
);
2387 CHECK_CALLED(GetDropTarget
);
2389 if(called_CreateInstance
) {
2390 CHECK_CALLED(CreateInstance
);
2391 CHECK_CALLED(Start
);
2392 CHECK_CALLED(LockRequest
);
2393 CHECK_CALLED(Terminate
);
2394 CHECK_CALLED(Protocol_Read
);
2395 CHECK_CALLED(UnlockRequest
);
2397 skip("CreateInstance not called. Assuming no Gecko installed.\n");
2399 SET_CALLED(CreateInstance
);
2401 SET_CALLED(LockRequest
);
2402 SET_CALLED(Terminate
);
2403 SET_CALLED(Protocol_Read
);
2404 SET_CALLED(UnlockRequest
);
2409 CHECK_CALLED(OnChanged_1005
);
2410 CHECK_CALLED(OnChanged_READYSTATE
);
2411 CHECK_CALLED(Exec_SETPROGRESSPOS
);
2412 CHECK_CALLED(Exec_SETDOWNLOADSTATE_0
);
2413 CHECK_CALLED(Exec_MSHTML_PARSECOMPLETE
);
2414 CHECK_CALLED(Exec_HTTPEQUIV_DONE
);
2416 load_state
= LD_COMPLETE
;
2418 test_readyState(NULL
);
2421 static void test_Persist(IUnknown
*unk
)
2423 IPersistMoniker
*persist_mon
;
2424 IPersistFile
*persist_file
;
2428 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistFile
, (void**)&persist_file
);
2429 ok(hres
== S_OK
, "QueryInterface(IID_IPersist) failed: %08x\n", hres
);
2430 if(SUCCEEDED(hres
)) {
2431 hres
= IPersist_GetClassID(persist_file
, NULL
);
2432 ok(hres
== E_INVALIDARG
, "GetClassID returned: %08x, expected E_INVALIDARG\n", hres
);
2434 hres
= IPersist_GetClassID(persist_file
, &guid
);
2435 ok(hres
== S_OK
, "GetClassID failed: %08x\n", hres
);
2436 ok(IsEqualGUID(&CLSID_HTMLDocument
, &guid
), "guid != CLSID_HTMLDocument\n");
2438 IPersist_Release(persist_file
);
2441 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistMoniker
, (void**)&persist_mon
);
2442 ok(hres
== S_OK
, "QueryInterface(IID_IPersistMoniker) failed: %08x\n", hres
);
2443 if(SUCCEEDED(hres
)) {
2444 hres
= IPersistMoniker_GetClassID(persist_mon
, NULL
);
2445 ok(hres
== E_INVALIDARG
, "GetClassID returned: %08x, expected E_INVALIDARG\n", hres
);
2447 hres
= IPersistMoniker_GetClassID(persist_mon
, &guid
);
2448 ok(hres
== S_OK
, "GetClassID failed: %08x\n", hres
);
2449 ok(IsEqualGUID(&CLSID_HTMLDocument
, &guid
), "guid != CLSID_HTMLDocument\n");
2451 if(load_state
== LD_DOLOAD
)
2452 test_Load(persist_mon
);
2454 test_readyState(unk
);
2456 IPersistMoniker_Release(persist_mon
);
2460 static const OLECMDF expect_cmds
[OLECMDID_GETPRINTTEMPLATE
+1] = {
2462 OLECMDF_SUPPORTED
, /* OLECMDID_OPEN */
2463 OLECMDF_SUPPORTED
, /* OLECMDID_NEW */
2464 OLECMDF_SUPPORTED
, /* OLECMDID_SAVE */
2465 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_SAVEAS */
2466 OLECMDF_SUPPORTED
, /* OLECMDID_SAVECOPYAS */
2467 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_PRINT */
2468 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_PRINTPREVIEW */
2469 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_PAGESETUP */
2470 OLECMDF_SUPPORTED
, /* OLECMDID_SPELL */
2471 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_PROPERTIES */
2472 OLECMDF_SUPPORTED
, /* OLECMDID_CUT */
2473 OLECMDF_SUPPORTED
, /* OLECMDID_COPY */
2474 OLECMDF_SUPPORTED
, /* OLECMDID_PASTE */
2475 OLECMDF_SUPPORTED
, /* OLECMDID_PASTESPECIAL */
2476 OLECMDF_SUPPORTED
, /* OLECMDID_UNDO */
2477 OLECMDF_SUPPORTED
, /* OLECMDID_REDO */
2478 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_SELECTALL */
2479 OLECMDF_SUPPORTED
, /* OLECMDID_CLEARSELECTION */
2480 OLECMDF_SUPPORTED
, /* OLECMDID_ZOOM */
2481 OLECMDF_SUPPORTED
, /* OLECMDID_GETZOOMRANGE */
2483 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_REFRESH */
2484 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
, /* OLECMDID_STOP */
2486 OLECMDF_SUPPORTED
, /* OLECMDID_STOPDOWNLOAD */
2488 OLECMDF_SUPPORTED
, /* OLECMDID_DELETE */
2490 OLECMDF_SUPPORTED
, /* OLECMDID_ENABLE_INTERACTION */
2491 OLECMDF_SUPPORTED
, /* OLECMDID_ONUNLOAD */
2493 OLECMDF_SUPPORTED
, /* OLECMDID_SHOWPAGESETUP */
2494 OLECMDF_SUPPORTED
, /* OLECMDID_SHOWPRINT */
2496 OLECMDF_SUPPORTED
, /* OLECMDID_CLOSE */
2498 OLECMDF_SUPPORTED
, /* OLECMDID_SETPRINTTEMPLATE */
2499 OLECMDF_SUPPORTED
/* OLECMDID_GETPRINTTEMPLATE */
2502 static void test_QueryStatus(IUnknown
*unk
, REFIID cgid
, ULONG cmdid
, DWORD cmdf
)
2504 IOleCommandTarget
*cmdtrg
;
2505 OLECMD olecmd
= {cmdid
, 0};
2508 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2509 ok(hres
== S_OK
, "QueryInterface(IID_IOleCommandTarget failed: %08x\n", hres
);
2513 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, cgid
, 1, &olecmd
, NULL
);
2514 ok(hres
== S_OK
, "QueryStatus(%u) failed: %08x\n", cmdid
, hres
);
2516 IOleCommandTarget_Release(cmdtrg
);
2518 ok(olecmd
.cmdID
== cmdid
, "cmdID changed\n");
2519 ok(olecmd
.cmdf
== cmdf
, "(%u) cmdf=%08x, expected %08x\n", cmdid
, olecmd
.cmdf
, cmdf
);
2522 static void test_MSHTML_QueryStatus(IUnknown
*unk
, DWORD cmdf
)
2527 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_FONTNAME
, cmdf
);
2528 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_FONTSIZE
, cmdf
);
2529 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_BOLD
, cmdf
);
2530 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_FORECOLOR
, cmdf
);
2531 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYCENTER
, cmdf
);
2532 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYLEFT
, cmdf
);
2533 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYRIGHT
, cmdf
);
2534 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_ITALIC
, cmdf
);
2535 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_UNDERLINE
, cmdf
);
2536 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_HORIZONTALLINE
, cmdf
);
2537 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_ORDERLIST
, cmdf
);
2538 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_UNORDERLIST
, cmdf
);
2539 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_INDENT
, cmdf
);
2540 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_OUTDENT
, cmdf
);
2543 static void test_OleCommandTarget(IUnknown
*unk
)
2545 IOleCommandTarget
*cmdtrg
;
2546 OLECMD cmds
[OLECMDID_GETPRINTTEMPLATE
];
2550 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2551 ok(hres
== S_OK
, "QueryInterface(IID_IOleCommandTarget failed: %08x\n", hres
);
2555 for(i
=0; i
<OLECMDID_GETPRINTTEMPLATE
; i
++) {
2556 cmds
[i
].cmdID
= i
+1;
2557 cmds
[i
].cmdf
= 0xf0f0;
2560 SET_EXPECT(QueryStatus_OPEN
);
2561 SET_EXPECT(QueryStatus_NEW
);
2562 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, NULL
, sizeof(cmds
)/sizeof(cmds
[0]), cmds
, NULL
);
2563 ok(hres
== S_OK
, "QueryStatus failed: %08x\n", hres
);
2564 CHECK_CALLED(QueryStatus_OPEN
);
2565 CHECK_CALLED(QueryStatus_NEW
);
2567 for(i
=0; i
<OLECMDID_GETPRINTTEMPLATE
; i
++) {
2568 ok(cmds
[i
].cmdID
== i
+1, "cmds[%d].cmdID canged to %x\n", i
, cmds
[i
].cmdID
);
2569 ok(cmds
[i
].cmdf
== expect_cmds
[i
+1], "cmds[%d].cmdf=%x, expected %x\n",
2570 i
+1, cmds
[i
].cmdf
, expect_cmds
[i
+1]);
2573 IOleCommandTarget_Release(cmdtrg
);
2576 static void test_OleCommandTarget_fail(IUnknown
*unk
)
2578 IOleCommandTarget
*cmdtrg
;
2583 {OLECMDID_OPEN
, 0xf0f0},
2584 {OLECMDID_GETPRINTTEMPLATE
+1, 0xf0f0}
2587 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2588 ok(hres
== S_OK
, "QueryInterface(IIDIOleCommandTarget failed: %08x\n", hres
);
2592 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, NULL
, 0, NULL
, NULL
);
2593 ok(hres
== S_OK
, "QueryStatus failed: %08x\n", hres
);
2595 SET_EXPECT(QueryStatus_OPEN
);
2596 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, NULL
, 2, cmd
, NULL
);
2597 CHECK_CALLED(QueryStatus_OPEN
);
2599 ok(hres
== OLECMDERR_E_NOTSUPPORTED
,
2600 "QueryStatus failed: %08x, expected OLECMDERR_E_NOTSUPPORTED\n", hres
);
2601 ok(cmd
[1].cmdID
== OLECMDID_GETPRINTTEMPLATE
+1,
2602 "cmd[0].cmdID=%d, expected OLECMDID_GETPRINTTEMPLATE+1\n", cmd
[0].cmdID
);
2603 ok(cmd
[1].cmdf
== 0, "cmd[0].cmdf=%x, expected 0\n", cmd
[0].cmdf
);
2604 ok(cmd
[0].cmdf
== OLECMDF_SUPPORTED
,
2605 "cmd[1].cmdf=%x, expected OLECMDF_SUPPORTED\n", cmd
[1].cmdf
);
2607 hres
= IOleCommandTarget_QueryStatus(cmdtrg
, &IID_IHTMLDocument2
, 2, cmd
, NULL
);
2608 ok(hres
== OLECMDERR_E_UNKNOWNGROUP
,
2609 "QueryStatus failed: %08x, expected OLECMDERR_E_UNKNOWNGROUP\n", hres
);
2611 for(i
=0; i
<OLECMDID_GETPRINTTEMPLATE
; i
++) {
2612 if(!expect_cmds
[i
]) {
2613 hres
= IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_UPDATECOMMANDS
,
2614 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2615 ok(hres
== OLECMDERR_E_NOTSUPPORTED
,
2616 "Exec failed: %08x, expected OLECMDERR_E_NOTSUPPORTED\n", hres
);
2620 hres
= IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_GETPRINTTEMPLATE
+1,
2621 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2622 ok(hres
== OLECMDERR_E_NOTSUPPORTED
,
2623 "Exec failed: %08x, expected OLECMDERR_E_NOTSUPPORTED\n", hres
);
2625 IOleCommandTarget_Release(cmdtrg
);
2628 static void test_exec_onunload(IUnknown
*unk
)
2630 IOleCommandTarget
*cmdtrg
;
2634 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2635 ok(hres
== S_OK
, "QueryInterface(IID_IOleCommandTarget) failed: %08x\n", hres
);
2639 memset(&var
, 0x0a, sizeof(var
));
2640 hres
= IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_ONUNLOAD
,
2641 OLECMDEXECOPT_DODEFAULT
, NULL
, &var
);
2642 ok(hres
== S_OK
, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08x\n", hres
);
2643 ok(V_VT(&var
) == VT_BOOL
, "V_VT(var)=%d, expected VT_BOOL\n", V_VT(&var
));
2644 ok(V_BOOL(&var
) == VARIANT_TRUE
, "V_BOOL(var)=%x, expected VARIANT_TRUE\n", V_BOOL(&var
));
2646 hres
= IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_ONUNLOAD
,
2647 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2648 ok(hres
== S_OK
, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08x\n", hres
);
2650 IOleCommandTarget_Release(cmdtrg
);
2653 static void test_exec_editmode(IUnknown
*unk
)
2655 IOleCommandTarget
*cmdtrg
;
2658 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2659 ok(hres
== S_OK
, "QueryInterface(IID_IOleCommandTarget) failed: %08x\n", hres
);
2665 SET_EXPECT(SetStatusText
);
2666 SET_EXPECT(Exec_ShellDocView_37
);
2667 SET_EXPECT(GetHostInfo
);
2668 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2669 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2670 SET_EXPECT(OnChanged_READYSTATE
);
2671 expect_status_text
= NULL
;
2672 readystate_set_loading
= TRUE
;
2674 hres
= IOleCommandTarget_Exec(cmdtrg
, &CGID_MSHTML
, IDM_EDITMODE
,
2675 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2676 ok(hres
== S_OK
, "Exec failed: %08x\n", hres
);
2678 CHECK_CALLED(SetStatusText
);
2679 CHECK_CALLED(Exec_ShellDocView_37
);
2680 CHECK_CALLED(GetHostInfo
);
2681 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2682 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2683 CHECK_CALLED(OnChanged_READYSTATE
);
2685 test_timer(EXPECT_UPDATEUI
|EXPECT_SETTITLE
);
2687 IOleCommandTarget_Release(cmdtrg
);
2689 hres
= IOleCommandTarget_Exec(cmdtrg
, &CGID_MSHTML
, IDM_EDITMODE
,
2690 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2691 ok(hres
== S_OK
, "Exec failed: %08x\n", hres
);
2694 static void test_exec_fontname(IUnknown
*unk
, LPCWSTR name
, LPCWSTR exname
)
2696 IOleCommandTarget
*cmdtrg
;
2697 VARIANT
*in
= NULL
, _in
, *out
= NULL
, _out
;
2700 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2701 ok(hres
== S_OK
, "QueryInterface(IIDIOleM=CommandTarget failed: %08x\n", hres
);
2708 V_BSTR(in
) = SysAllocString(name
);
2714 V_I4(out
) = 0xdeadbeef;
2717 hres
= IOleCommandTarget_Exec(cmdtrg
, &CGID_MSHTML
, IDM_FONTNAME
, 0, in
, out
);
2719 ok(hres
== S_OK
, "Exec(IDM_FONTNAME) failed: %08x\n", hres
);
2724 if(out
&& !nogecko
) {
2725 ok(V_VT(out
) == VT_BSTR
, "V_VT(out) = %x\n", V_VT(out
));
2726 if(V_VT(out
) == VT_BSTR
)
2727 ok(!lstrcmpW(V_BSTR(out
), name
? name
: exname
), "unexpected fontname\n");
2731 IOleCommandTarget_Release(cmdtrg
);
2734 static void test_exec_noargs(IUnknown
*unk
, DWORD cmdid
)
2736 IOleCommandTarget
*cmdtrg
;
2739 hres
= IUnknown_QueryInterface(unk
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
2740 ok(hres
== S_OK
, "QueryInterface(IID_IOleCommandTarget) failed: %08x\n", hres
);
2744 hres
= IOleCommandTarget_Exec(cmdtrg
, &CGID_MSHTML
, cmdid
,
2745 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
2746 ok(hres
== S_OK
, "Exec failed: %08x\n", hres
);
2748 IOleCommandTarget_Release(cmdtrg
);
2751 static void test_IsDirty(IUnknown
*unk
, HRESULT exhres
)
2753 IPersistStreamInit
*perinit
;
2754 IPersistMoniker
*permon
;
2755 IPersistFile
*perfile
;
2758 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistStreamInit
, (void**)&perinit
);
2759 ok(hres
== S_OK
, "QueryInterface(IID_IPersistStreamInit failed: %08x\n", hres
);
2760 if(SUCCEEDED(hres
)) {
2761 hres
= IPersistStreamInit_IsDirty(perinit
);
2762 ok(hres
== exhres
, "IsDirty() = %08x, expected %08x\n", hres
, exhres
);
2763 IPersistStreamInit_Release(perinit
);
2766 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistMoniker
, (void**)&permon
);
2767 ok(hres
== S_OK
, "QueryInterface(IID_IPersistMoniker failed: %08x\n", hres
);
2768 if(SUCCEEDED(hres
)) {
2769 hres
= IPersistMoniker_IsDirty(permon
);
2770 ok(hres
== exhres
, "IsDirty() = %08x, expected %08x\n", hres
, exhres
);
2771 IPersistMoniker_Release(permon
);
2774 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistFile
, (void**)&perfile
);
2775 ok(hres
== S_OK
, "QueryInterface(IID_IPersistFile failed: %08x\n", hres
);
2776 if(SUCCEEDED(hres
)) {
2777 hres
= IPersistFile_IsDirty(perfile
);
2778 ok(hres
== exhres
, "IsDirty() = %08x, expected %08x\n", hres
, exhres
);
2779 IPersistFile_Release(perfile
);
2783 static HWND
create_container_window(void)
2785 static const WCHAR wszHTMLDocumentTest
[] =
2786 {'H','T','M','L','D','o','c','u','m','e','n','t','T','e','s','t',0};
2787 static WNDCLASSEXW wndclass
= {
2788 sizeof(WNDCLASSEXW
),
2791 0, 0, NULL
, NULL
, NULL
, NULL
, NULL
,
2792 wszHTMLDocumentTest
,
2796 RegisterClassExW(&wndclass
);
2797 return CreateWindowW(wszHTMLDocumentTest
, wszHTMLDocumentTest
,
2798 WS_OVERLAPPEDWINDOW
, CW_USEDEFAULT
, CW_USEDEFAULT
, CW_USEDEFAULT
,
2799 CW_USEDEFAULT
, NULL
, NULL
, NULL
, NULL
);
2802 static HRESULT
test_DoVerb(IOleObject
*oleobj
)
2804 RECT rect
= {0,0,500,500};
2807 if(!container_locked
) {
2808 SET_EXPECT(GetContainer
);
2809 SET_EXPECT(LockContainer
);
2811 SET_EXPECT(ActivateMe
);
2812 expect_LockContainer_fLock
= TRUE
;
2814 hres
= IOleObject_DoVerb(oleobj
, OLEIVERB_SHOW
, NULL
, &ClientSite
, -1, container_hwnd
, &rect
);
2817 ok(hres
== S_OK
, "DoVerb failed: %08x\n", hres
);
2819 if(!container_locked
) {
2820 CHECK_CALLED(GetContainer
);
2821 CHECK_CALLED(LockContainer
);
2822 container_locked
= TRUE
;
2824 CHECK_CALLED(ActivateMe
);
2829 #define CLIENTSITE_EXPECTPATH 0x00000001
2830 #define CLIENTSITE_SETNULL 0x00000002
2831 #define CLIENTSITE_DONTSET 0x00000004
2833 static void test_ClientSite(IOleObject
*oleobj
, DWORD flags
)
2835 IOleClientSite
*clientsite
;
2838 if(flags
& CLIENTSITE_SETNULL
) {
2839 hres
= IOleObject_GetClientSite(oleobj
, &clientsite
);
2840 ok(clientsite
== &ClientSite
, "clientsite=%p, expected %p\n", clientsite
, &ClientSite
);
2842 hres
= IOleObject_SetClientSite(oleobj
, NULL
);
2843 ok(hres
== S_OK
, "SetClientSite failed: %08x\n", hres
);
2845 set_clientsite
= FALSE
;
2848 if(flags
& CLIENTSITE_DONTSET
)
2851 hres
= IOleObject_GetClientSite(oleobj
, &clientsite
);
2852 ok(hres
== S_OK
, "GetClientSite failed: %08x\n", hres
);
2853 ok(clientsite
== (set_clientsite
? &ClientSite
: NULL
), "GetClientSite() = %p, expected %p\n",
2854 clientsite
, set_clientsite
? &ClientSite
: NULL
);
2856 if(!set_clientsite
) {
2857 SET_EXPECT(GetHostInfo
);
2858 if(flags
& CLIENTSITE_EXPECTPATH
) {
2859 SET_EXPECT(GetOptionKeyPath
);
2860 SET_EXPECT(GetOverrideKeyPath
);
2862 SET_EXPECT(GetWindow
);
2863 SET_EXPECT(QueryStatus_SETPROGRESSTEXT
);
2864 SET_EXPECT(Exec_SETPROGRESSMAX
);
2865 SET_EXPECT(Exec_SETPROGRESSPOS
);
2866 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
2867 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2868 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2869 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2870 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
2871 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
2873 hres
= IOleObject_SetClientSite(oleobj
, &ClientSite
);
2874 ok(hres
== S_OK
, "SetClientSite failed: %08x\n", hres
);
2876 CHECK_CALLED(GetHostInfo
);
2877 if(flags
& CLIENTSITE_EXPECTPATH
) {
2878 CHECK_CALLED(GetOptionKeyPath
);
2879 CHECK_CALLED(GetOverrideKeyPath
);
2881 CHECK_CALLED(GetWindow
);
2882 CHECK_CALLED(QueryStatus_SETPROGRESSTEXT
);
2883 CHECK_CALLED(Exec_SETPROGRESSMAX
);
2884 CHECK_CALLED(Exec_SETPROGRESSPOS
);
2885 CHECK_CALLED(Invoke_AMBIENT_USERMODE
);
2886 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2887 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2888 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2889 CHECK_CALLED(Invoke_AMBIENT_USERAGENT
);
2890 CHECK_CALLED(Invoke_AMBIENT_PALETTE
);
2892 set_clientsite
= TRUE
;
2895 hres
= IOleObject_SetClientSite(oleobj
, &ClientSite
);
2896 ok(hres
== S_OK
, "SetClientSite failed: %08x\n", hres
);
2898 hres
= IOleObject_GetClientSite(oleobj
, &clientsite
);
2899 ok(hres
== S_OK
, "GetClientSite failed: %08x\n", hres
);
2900 ok(clientsite
== &ClientSite
, "GetClientSite() = %p, expected %p\n", clientsite
, &ClientSite
);
2903 static void test_OnAmbientPropertyChange(IUnknown
*unk
)
2905 IOleControl
*control
= NULL
;
2908 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
2909 ok(hres
== S_OK
, "QueryInterface(IID_IOleControl failed: %08x\n", hres
);
2913 SET_EXPECT(Invoke_AMBIENT_USERMODE
);
2914 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_USERMODE
);
2915 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2916 CHECK_CALLED(Invoke_AMBIENT_USERMODE
);
2918 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2919 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_DLCONTROL
);
2920 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2921 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2923 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2924 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2925 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
);
2926 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2927 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2928 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
2930 SET_EXPECT(Invoke_AMBIENT_DLCONTROL
);
2931 SET_EXPECT(Invoke_AMBIENT_SILENT
);
2932 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_SILENT
);
2933 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2934 CHECK_CALLED(Invoke_AMBIENT_DLCONTROL
);
2935 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
2937 SET_EXPECT(Invoke_AMBIENT_USERAGENT
);
2938 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_USERAGENT
);
2939 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2940 CHECK_CALLED(Invoke_AMBIENT_USERAGENT
);
2942 SET_EXPECT(Invoke_AMBIENT_PALETTE
);
2943 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_PALETTE
);
2944 ok(hres
== S_OK
, "OnAmbientChange failed: %08x\n", hres
);
2945 CHECK_CALLED(Invoke_AMBIENT_PALETTE
);
2947 IOleControl_Release(control
);
2952 static void test_OnAmbientPropertyChange2(IUnknown
*unk
)
2954 IOleControl
*control
= NULL
;
2957 hres
= IUnknown_QueryInterface(unk
, &IID_IOleControl
, (void**)&control
);
2958 ok(hres
== S_OK
, "QueryInterface(IID_IOleControl failed: %08x\n", hres
);
2962 hres
= IOleControl_OnAmbientPropertyChange(control
, DISPID_AMBIENT_PALETTE
);
2963 ok(hres
== S_OK
, "OnAmbientPropertyChange failed: %08x\n", hres
);
2965 IOleControl_Release(control
);
2968 static void test_Close(IUnknown
*unk
, BOOL set_client
)
2970 IOleObject
*oleobj
= NULL
;
2973 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
2974 ok(hres
== S_OK
, "QueryInterface(IID_IOleObject) failed: %08x\n", hres
);
2978 SET_EXPECT(GetContainer
);
2979 SET_EXPECT(LockContainer
);
2980 expect_LockContainer_fLock
= FALSE
;
2981 hres
= IOleObject_Close(oleobj
, OLECLOSE_NOSAVE
);
2982 ok(hres
== S_OK
, "Close failed: %08x\n", hres
);
2983 CHECK_CALLED(GetContainer
);
2984 CHECK_CALLED(LockContainer
);
2985 container_locked
= FALSE
;
2988 test_ClientSite(oleobj
, CLIENTSITE_SETNULL
|CLIENTSITE_DONTSET
);
2990 IOleObject_Release(oleobj
);
2993 static void test_OnFrameWindowActivate(IUnknown
*unk
)
2995 IOleInPlaceActiveObject
*inplaceact
;
2998 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceActiveObject
, (void**)&inplaceact
);
2999 ok(hres
== S_OK
, "QueryInterface(IID_IOleInPlaceActiveObject) failed: %08x\n", hres
);
3003 if(set_clientsite
) {
3004 expect_OnFrameWindowActivate_fActivate
= TRUE
;
3005 SET_EXPECT(OnFrameWindowActivate
);
3006 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, TRUE
);
3007 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3008 CHECK_CALLED(OnFrameWindowActivate
);
3010 SET_EXPECT(OnFrameWindowActivate
);
3011 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, TRUE
);
3012 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3013 CHECK_CALLED(OnFrameWindowActivate
);
3015 expect_OnFrameWindowActivate_fActivate
= FALSE
;
3016 SET_EXPECT(OnFrameWindowActivate
);
3017 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, FALSE
);
3018 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3019 CHECK_CALLED(OnFrameWindowActivate
);
3021 expect_OnFrameWindowActivate_fActivate
= TRUE
;
3022 SET_EXPECT(OnFrameWindowActivate
);
3023 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, TRUE
);
3024 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3025 CHECK_CALLED(OnFrameWindowActivate
);
3027 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, FALSE
);
3028 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3030 hres
= IOleInPlaceActiveObject_OnFrameWindowActivate(inplaceact
, TRUE
);
3031 ok(hres
== S_OK
, "OnFrameWindowActivate failed: %08x\n", hres
);
3034 IOleInPlaceActiveObject_Release(inplaceact
);
3037 static void test_InPlaceDeactivate(IUnknown
*unk
, BOOL expect_call
)
3039 IOleInPlaceObjectWindowless
*windowlessobj
= NULL
;
3042 hres
= IUnknown_QueryInterface(unk
, &IID_IOleInPlaceObjectWindowless
,
3043 (void**)&windowlessobj
);
3044 ok(hres
== S_OK
, "QueryInterface(IID_IOleInPlaceObjectWindowless) failed: %08x\n", hres
);
3048 if(expect_call
) SET_EXPECT(OnInPlaceDeactivate
);
3049 hres
= IOleInPlaceObjectWindowless_InPlaceDeactivate(windowlessobj
);
3050 ok(hres
== S_OK
, "InPlaceDeactivate failed: %08x\n", hres
);
3051 if(expect_call
) CHECK_CALLED(OnInPlaceDeactivate
);
3053 IOleInPlaceObjectWindowless_Release(windowlessobj
);
3056 static HRESULT
test_Activate(IUnknown
*unk
, DWORD flags
)
3058 IOleObject
*oleobj
= NULL
;
3065 IOleDocumentView_Release(view
);
3068 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
3069 ok(hres
== S_OK
, "QueryInterface(IID_IOleObject) failed: %08x\n", hres
);
3073 hres
= IOleObject_GetUserClassID(oleobj
, NULL
);
3074 ok(hres
== E_INVALIDARG
, "GetUserClassID returned: %08x, expected E_INVALIDARG\n", hres
);
3076 hres
= IOleObject_GetUserClassID(oleobj
, &guid
);
3077 ok(hres
== S_OK
, "GetUserClassID failed: %08x\n", hres
);
3078 ok(IsEqualGUID(&guid
, &CLSID_HTMLDocument
), "guid != CLSID_HTMLDocument\n");
3080 test_OnFrameWindowActivate(unk
);
3082 test_ClientSite(oleobj
, flags
);
3083 test_InPlaceDeactivate(unk
, FALSE
);
3085 hres
= test_DoVerb(oleobj
);
3087 IOleObject_Release(oleobj
);
3089 test_OnFrameWindowActivate(unk
);
3094 static void test_Window(IUnknown
*unk
, BOOL expect_success
)
3096 IOleInPlaceActiveObject
*activeobject
= NULL
;
3100 hres
= IOleDocumentView_QueryInterface(view
, &IID_IOleInPlaceActiveObject
, (void**)&activeobject
);
3101 ok(hres
== S_OK
, "Could not get IOleInPlaceActiveObject interface: %08x\n", hres
);
3105 hres
= IOleInPlaceActiveObject_GetWindow(activeobject
, &tmp_hwnd
);
3107 if(expect_success
) {
3108 ok(hres
== S_OK
, "GetWindow failed: %08x\n", hres
);
3109 ok(tmp_hwnd
== hwnd
, "tmp_hwnd=%p, expected %p\n", tmp_hwnd
, hwnd
);
3111 ok(hres
== E_FAIL
, "GetWindow returned %08x, expected E_FAIL\n", hres
);
3112 ok(IsWindow(hwnd
), "hwnd is destroyed\n");
3115 IOleInPlaceActiveObject_Release(activeobject
);
3118 static void test_CloseView(void)
3120 IOleInPlaceSite
*inplacesite
= (IOleInPlaceSite
*)0xff00ff00;
3126 hres
= IOleDocumentView_Show(view
, FALSE
);
3127 ok(hres
== S_OK
, "Show failed: %08x\n", hres
);
3129 hres
= IOleDocumentView_CloseView(view
, 0);
3130 ok(hres
== S_OK
, "CloseView failed: %08x\n", hres
);
3132 hres
= IOleDocumentView_SetInPlaceSite(view
, NULL
);
3133 ok(hres
== S_OK
, "SetInPlaceSite failed: %08x\n", hres
);
3135 hres
= IOleDocumentView_GetInPlaceSite(view
, &inplacesite
);
3136 ok(hres
== S_OK
, "SetInPlaceSite failed: %08x\n", hres
);
3137 ok(inplacesite
== NULL
, "inplacesite=%p, expected NULL\n", inplacesite
);
3140 static void test_UIDeactivate(void)
3144 if(call_UIActivate
) {
3145 SET_EXPECT(SetActiveObject
);
3147 SET_EXPECT(OnUIDeactivate
);
3150 expect_SetActiveObject_active
= FALSE
;
3151 hres
= IOleDocumentView_UIActivate(view
, FALSE
);
3152 ok(hres
== S_OK
, "UIActivate failed: %08x\n", hres
);
3154 if(call_UIActivate
) {
3155 CHECK_CALLED(SetActiveObject
);
3156 CHECK_CALLED(HideUI
);
3157 CHECK_CALLED(OnUIDeactivate
);
3161 static void test_Hide(void)
3168 hres
= IOleDocumentView_Show(view
, FALSE
);
3169 ok(hres
== S_OK
, "Show failed: %08x\n", hres
);
3172 static HRESULT
create_document(IUnknown
**unk
)
3174 HRESULT hres
= CoCreateInstance(&CLSID_HTMLDocument
, NULL
, CLSCTX_INPROC_SERVER
|CLSCTX_INPROC_HANDLER
,
3175 &IID_IUnknown
, (void**)unk
);
3176 ok(hres
== S_OK
, "CoCreateInstance failed: %08x\n", hres
);
3180 static void test_Navigate(IUnknown
*unk
)
3182 IHlinkTarget
*hlink
;
3185 hres
= IUnknown_QueryInterface(unk
, &IID_IHlinkTarget
, (void**)&hlink
);
3186 ok(hres
== S_OK
, "QueryInterface(IID_IHlinkTarget) failed: %08x\n", hres
);
3188 SET_EXPECT(ActivateMe
);
3189 hres
= IHlinkTarget_Navigate(hlink
, 0, NULL
);
3190 ok(hres
== S_OK
, "Navigate failed: %08x\n", hres
);
3191 CHECK_CALLED(ActivateMe
);
3193 IHlinkTarget_Release(hlink
);
3196 static void test_StreamLoad(IUnknown
*unk
)
3198 IPersistStreamInit
*init
;
3201 hres
= IUnknown_QueryInterface(unk
, &IID_IPersistStreamInit
, (void**)&init
);
3202 ok(hres
== S_OK
, "QueryInterface(IID_IPersistStreamInit) failed: %08x\n", hres
);
3206 SET_EXPECT(Invoke_AMBIENT_SILENT
);
3207 SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
3208 SET_EXPECT(Exec_ShellDocView_37
);
3209 SET_EXPECT(OnChanged_READYSTATE
);
3211 readystate_set_loading
= TRUE
;
3213 hres
= IPersistStreamInit_Load(init
, &Stream
);
3214 ok(hres
== S_OK
, "Load failed: %08x\n", hres
);
3216 CHECK_CALLED(Invoke_AMBIENT_SILENT
);
3217 CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED
);
3218 CHECK_CALLED(Exec_ShellDocView_37
);
3219 CHECK_CALLED(OnChanged_READYSTATE
);
3222 test_timer(EXPECT_SETTITLE
);
3223 test_GetCurMoniker(unk
, NULL
, about_blank_url
);
3225 IPersistStreamInit_Release(init
);
3228 static void test_QueryInterface(IUnknown
*unk
)
3230 IRunnableObject
*runnable
= (IRunnableObject
*)0xdeadbeef;
3233 hres
= IUnknown_QueryInterface(unk
, &IID_IRunnableObject
, (void**)&runnable
);
3234 ok(hres
== E_NOINTERFACE
, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres
);
3235 ok(runnable
== NULL
, "runnable=%p, ezpected NULL\n", runnable
);
3238 static void init_test(enum load_state_t ls
) {
3240 hwnd
= last_hwnd
= NULL
;
3241 set_clientsite
= FALSE
;
3242 load_from_stream
= FALSE
;
3243 call_UIActivate
= FALSE
;
3250 static void test_HTMLDocument(enum load_state_t ls
)
3256 trace("Testing HTMLDocument (%s)...\n", (ls
== LD_DOLOAD
? " load" : "no load"));
3260 hres
= create_document(&unk
);
3265 test_QueryInterface(unk
);
3266 test_IsDirty(unk
, S_FALSE
);
3267 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3268 test_ConnectionPointContainer(unk
);
3269 test_GetCurMoniker(unk
, NULL
, NULL
);
3271 if(load_state
== LD_NO
)
3272 test_OnAmbientPropertyChange2(unk
);
3274 hres
= test_Activate(unk
, CLIENTSITE_EXPECTPATH
);
3276 IUnknown_Release(unk
);
3280 if(load_state
== LD_LOADING
) {
3281 test_download(FALSE
, TRUE
);
3282 test_GetCurMoniker(unk
, &Moniker
, NULL
);
3285 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3286 test_OleCommandTarget_fail(unk
);
3287 test_OleCommandTarget(unk
);
3288 test_OnAmbientPropertyChange(unk
);
3289 test_Window(unk
, TRUE
);
3291 test_UIDeactivate();
3292 test_OleCommandTarget(unk
);
3293 test_Window(unk
, TRUE
);
3294 test_InPlaceDeactivate(unk
, TRUE
);
3296 /* Calling test_OleCommandTarget here couses Segmentation Fault with native
3297 * MSHTML. It doesn't with Wine. */
3299 test_Window(unk
, FALSE
);
3301 test_InPlaceDeactivate(unk
, FALSE
);
3303 test_Close(unk
, FALSE
);
3305 /* Activate HTMLDocument again */
3306 test_Activate(unk
, CLIENTSITE_SETNULL
);
3307 test_Window(unk
, TRUE
);
3308 test_OleCommandTarget(unk
);
3309 test_UIDeactivate();
3310 test_InPlaceDeactivate(unk
, TRUE
);
3311 test_Close(unk
, FALSE
);
3313 /* Activate HTMLDocument again, this time without UIActivate */
3314 call_UIActivate
= FALSE
;
3315 test_Activate(unk
, CLIENTSITE_SETNULL
);
3316 test_Window(unk
, TRUE
);
3317 test_UIDeactivate();
3318 test_InPlaceDeactivate(unk
, TRUE
);
3321 test_Close(unk
, TRUE
);
3322 test_OnAmbientPropertyChange2(unk
);
3323 test_GetCurMoniker(unk
, load_state
== LD_NO
? NULL
: &Moniker
, NULL
);
3326 IOleDocumentView_Release(view
);
3329 ok(IsWindow(hwnd
), "hwnd is destroyed\n");
3331 ref
= IUnknown_Release(unk
);
3332 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3334 ok(!IsWindow(hwnd
), "hwnd is not destroyed\n");
3337 static void test_HTMLDocument_hlink(void)
3343 trace("Testing HTMLDocument (hlink)...\n");
3345 init_test(LD_DOLOAD
);
3347 hres
= create_document(&unk
);
3352 test_ConnectionPointContainer(unk
);
3353 test_GetCurMoniker(unk
, NULL
, NULL
);
3357 test_download(FALSE
, TRUE
);
3359 test_IsDirty(unk
, S_FALSE
);
3360 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3361 test_exec_onunload(unk
);
3362 test_Window(unk
, TRUE
);
3363 test_InPlaceDeactivate(unk
, TRUE
);
3364 test_Close(unk
, FALSE
);
3365 test_IsDirty(unk
, S_FALSE
);
3366 test_GetCurMoniker(unk
, &Moniker
, NULL
);
3369 IOleDocumentView_Release(view
);
3372 ref
= IUnknown_Release(unk
);
3373 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3376 static void test_HTMLDocument_StreamLoad(void)
3383 trace("Testing HTMLDocument (IPersistStreamInit)...\n");
3385 init_test(LD_DOLOAD
);
3386 load_from_stream
= TRUE
;
3388 hres
= create_document(&unk
);
3393 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
3394 ok(hres
== S_OK
, "Could not get IOleObject: %08x\n", hres
);
3396 test_readyState(unk
);
3397 test_IsDirty(unk
, S_FALSE
);
3398 test_ConnectionPointContainer(unk
);
3399 test_ClientSite(oleobj
, CLIENTSITE_EXPECTPATH
);
3400 test_DoVerb(oleobj
);
3401 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3403 IOleObject_Release(oleobj
);
3405 test_GetCurMoniker(unk
, NULL
, NULL
);
3406 test_StreamLoad(unk
);
3407 test_download(TRUE
, FALSE
);
3409 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3410 test_UIDeactivate();
3411 test_InPlaceDeactivate(unk
, TRUE
);
3412 test_Close(unk
, FALSE
);
3413 test_IsDirty(unk
, S_FALSE
);
3416 IOleDocumentView_Release(view
);
3421 ref
= IUnknown_Release(unk
);
3422 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3425 static void test_editing_mode(void)
3432 trace("Testing HTMLDocument (edit)...\n");
3434 init_test(LD_DOLOAD
);
3436 hres
= create_document(&unk
);
3441 hres
= IUnknown_QueryInterface(unk
, &IID_IOleObject
, (void**)&oleobj
);
3442 ok(hres
== S_OK
, "Could not get IOleObject: %08x\n", hres
);
3444 test_readyState(unk
);
3445 test_ConnectionPointContainer(unk
);
3446 test_ClientSite(oleobj
, CLIENTSITE_EXPECTPATH
);
3447 test_DoVerb(oleobj
);
3448 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3450 IOleObject_Release(oleobj
);
3452 test_exec_editmode(unk
);
3453 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
);
3454 test_download(TRUE
, FALSE
);
3455 test_timer(EXPECT_UPDATEUI
);
3456 test_MSHTML_QueryStatus(unk
, OLECMDF_SUPPORTED
|OLECMDF_ENABLED
);
3458 test_exec_fontname(unk
, NULL
, wszTimesNewRoman
);
3459 test_exec_fontname(unk
, wszArial
, wszTimesNewRoman
);
3460 test_timer(EXPECT_UPDATEUI
);
3461 test_exec_fontname(unk
, NULL
, wszArial
);
3463 test_exec_noargs(unk
, IDM_JUSTIFYRIGHT
);
3464 test_timer(EXPECT_UPDATEUI
);
3466 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYRIGHT
,
3467 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
|OLECMDF_LATCHED
);
3469 test_exec_noargs(unk
, IDM_JUSTIFYCENTER
);
3470 test_timer(EXPECT_UPDATEUI
);
3471 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYRIGHT
,
3472 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
);
3474 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_JUSTIFYCENTER
,
3475 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
|OLECMDF_LATCHED
);
3477 test_exec_noargs(unk
, IDM_HORIZONTALLINE
);
3478 test_timer(EXPECT_UPDATEUI
);
3479 test_QueryStatus(unk
, &CGID_MSHTML
, IDM_HORIZONTALLINE
,
3480 OLECMDF_SUPPORTED
|OLECMDF_ENABLED
);
3482 test_UIDeactivate();
3483 test_InPlaceDeactivate(unk
, TRUE
);
3484 test_Close(unk
, FALSE
);
3487 IOleDocumentView_Release(view
);
3491 ref
= IUnknown_Release(unk
);
3492 ok(ref
== 0, "ref=%d, expected 0\n", ref
);
3495 static void register_protocol(void)
3497 IInternetSession
*session
;
3500 static const WCHAR wsz_winetest
[] = {'w','i','n','e','t','e','s','t',0};
3502 hres
= CoInternetGetSession(0, &session
, 0);
3503 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
3505 hres
= IInternetSession_RegisterNameSpace(session
, &ClassFactory
, &IID_NULL
,
3506 wsz_winetest
, 0, NULL
, 0);
3507 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
3509 IInternetSession_Release(session
);
3512 static void gecko_installer_workaround(BOOL disable
)
3517 static BOOL has_url
= FALSE
;
3518 static char url
[2048];
3520 if(!disable
&& !has_url
)
3523 res
= RegOpenKey(HKEY_CURRENT_USER
, "Software\\Wine\\MSHTML", &hkey
);
3524 if(res
!= ERROR_SUCCESS
)
3528 DWORD type
, size
= sizeof(url
);
3530 res
= RegQueryValueEx(hkey
, "GeckoUrl", NULL
, &type
, (PVOID
)url
, &size
);
3531 if(res
== ERROR_SUCCESS
&& type
== REG_SZ
)
3534 RegDeleteValue(hkey
, "GeckoUrl");
3536 RegSetValueEx(hkey
, "GeckoUrl", 0, REG_SZ
, (PVOID
)url
, lstrlenA(url
)+1);
3544 gecko_installer_workaround(TRUE
);
3547 container_hwnd
= create_container_window();
3548 register_protocol();
3550 test_HTMLDocument(LD_NO
);
3551 test_HTMLDocument(LD_DOLOAD
);
3552 test_HTMLDocument_hlink();
3553 test_HTMLDocument_StreamLoad();
3554 test_editing_mode();
3556 DestroyWindow(container_hwnd
);
3559 gecko_installer_workaround(FALSE
);