2 * Copyright 2012 Piotr 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
31 #include "wine/test.h"
33 DEFINE_GUID(CLSID_XMLView, 0x48123bc4, 0x99d9, 0x11d1, 0xa6,0xb3, 0x00,0xc0,0x4f,0xd9,0x15,0x55);
35 static void test_QueryInterface(void)
37 IUnknown *xmlview, *unk;
38 IHTMLDocument *htmldoc;
41 hres = CoCreateInstance(&CLSID_XMLView, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
42 &IID_IUnknown, (void**)&xmlview);
43 if(hres == REGDB_E_CLASSNOTREG) {
44 win_skip("XMLView class not registered\n");
47 ok(hres == S_OK, "CoCreateInstance returned %x, expected S_OK\n", hres);
49 hres = IUnknown_QueryInterface(xmlview, &IID_IPersistMoniker, (void**)&unk);
50 ok(hres == S_OK, "QueryInterface(IID_IPersistMoniker) returned %x, expected S_OK\n", hres);
51 IUnknown_Release(unk);
53 hres = IUnknown_QueryInterface(xmlview, &IID_IPersistHistory, (void**)&unk);
54 ok(hres == S_OK, "QueryInterface(IID_IPersistHistory) returned %x, expected S_OK\n", hres);
55 IUnknown_Release(unk);
57 hres = IUnknown_QueryInterface(xmlview, &IID_IOleCommandTarget, (void**)&unk);
58 ok(hres == S_OK, "QueryInterface(IID_IOleCommandTarget) returned %x, expected S_OK\n", hres);
59 IUnknown_Release(unk);
61 hres = IUnknown_QueryInterface(xmlview, &IID_IOleObject, (void**)&unk);
62 ok(hres == S_OK, "QueryInterface(IID_IOleObject) returned %x, expected S_OK\n", hres);
63 IUnknown_Release(unk);
65 hres = IUnknown_QueryInterface(xmlview, &IID_IHTMLDocument, (void**)&htmldoc);
66 ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument) returned %x, expected S_OK\n", hres);
67 hres = IHTMLDocument_QueryInterface(htmldoc, &IID_IUnknown, (void**)&unk);
68 ok(hres == S_OK, "QueryInterface(IID_IUnknown) returned %x, expected S_OK\n", hres);
69 todo_wine ok(unk == xmlview, "Aggregation is not working as expected\n");
70 IUnknown_Release(unk);
71 IHTMLDocument_Release(htmldoc);
73 IUnknown_Release(xmlview);
79 test_QueryInterface();