ieframe: Moved WebBrowser object tests to ieframe.
[wine.git] / dlls / ieframe / tests / ie.c
blob6f62e23107cdbf2b1a7849300287c93e20f8f681
1 /*
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
19 #define COBJMACROS
21 #include <wine/test.h>
22 #include <stdarg.h>
23 #include <stdio.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "ole2.h"
28 #include "exdisp.h"
30 static void test_visible(IWebBrowser2 *wb)
32 VARIANT_BOOL b;
33 HRESULT hres;
35 b = 0x100;
36 hres = IWebBrowser2_get_Visible(wb, &b);
37 ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
38 ok(b == VARIANT_FALSE, "Visible = %x\n", hres);
40 hres = IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
41 ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
43 b = 0x100;
44 hres = IWebBrowser2_get_Visible(wb, &b);
45 ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
46 ok(b == VARIANT_TRUE, "Visible = %x\n", hres);
48 hres = IWebBrowser2_put_Visible(wb, VARIANT_FALSE);
49 ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
52 static void test_InternetExplorer(void)
54 IWebBrowser2 *wb;
55 IUnknown *unk;
56 ULONG ref;
57 HRESULT hres;
59 hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
60 &IID_IUnknown, (void**)&unk);
61 ok(hres == S_OK, "Could not create InternetExplorer instance: %08x\n", hres);
63 hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
64 ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
66 test_visible(wb);
68 IWebBrowser2_Release(wb);
69 ref = IUnknown_Release(unk);
70 ok(!ref, "object not destroyed, ref=%u\n", ref);
73 START_TEST(ie)
75 CoInitialize(NULL);
77 test_InternetExplorer();
79 CoUninitialize();