quartz: Free two assert calls from having side effects.
[wine/testsucceed.git] / dlls / ieframe / tests / ie.c
blobb761c6f03c46efc649029e58741cc0790838b5e9
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 if(hres != S_OK)
64 return;
66 hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
67 ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
69 test_visible(wb);
71 IWebBrowser2_Release(wb);
72 ref = IUnknown_Release(unk);
73 ok(!ref, "object not destroyed, ref=%u\n", ref);
76 START_TEST(ie)
78 CoInitialize(NULL);
80 test_InternetExplorer();
82 CoUninitialize();