2 * Copyright 2011 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
21 #include <wine/test.h>
31 static void test_visible(IWebBrowser2 *wb)
37 hres = IWebBrowser2_get_Visible(wb, &b);
38 ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
39 ok(b == VARIANT_FALSE, "Visible = %x\n", hres);
41 hres = IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
42 ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
45 hres = IWebBrowser2_get_Visible(wb, &b);
46 ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
47 ok(b == VARIANT_TRUE, "Visible = %x\n", hres);
49 hres = IWebBrowser2_put_Visible(wb, VARIANT_FALSE);
50 ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
53 static void test_html_window(IWebBrowser2 *wb)
55 IHTMLWindow2 *html_window;
59 hres = IWebBrowser2_QueryInterface(wb, &IID_IServiceProvider, (void**)&sp);
60 ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres);
62 hres = IServiceProvider_QueryService(sp, &SID_SHTMLWindow, &IID_IHTMLWindow2, (void**)&html_window);
63 IServiceProvider_Release(sp);
64 ok(hres == S_OK, "Could not get SHTMLWindow service: %08x\n", hres);
66 IHTMLWindow2_Release(html_window);
69 static void test_InternetExplorer(void)
76 hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
77 &IID_IUnknown, (void**)&unk);
78 ok(hres == S_OK, "Could not create InternetExplorer instance: %08x\n", hres);
83 hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
84 ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
89 IWebBrowser2_Release(wb);
90 ref = IUnknown_Release(unk);
91 ok(!ref, "object not destroyed, ref=%u\n", ref);
98 test_InternetExplorer();