Jacek Caban : shdocvw: Added InternetExplorer object tests.

Alexandre Julliard julliard at winehq.org
Mon Jan 10 10:55:16 CST 2011


Module: wine
Branch: master
Commit: 74ccbf0083db5aef3821a51c823cbf7e9f6d1221
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=74ccbf0083db5aef3821a51c823cbf7e9f6d1221

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jan  7 19:04:07 2011 +0100

shdocvw: Added InternetExplorer object tests.

---

 dlls/shdocvw/tests/Makefile.in |    1 +
 dlls/shdocvw/tests/ie.c        |   59 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/dlls/shdocvw/tests/Makefile.in b/dlls/shdocvw/tests/Makefile.in
index 10474a1..53f2130 100644
--- a/dlls/shdocvw/tests/Makefile.in
+++ b/dlls/shdocvw/tests/Makefile.in
@@ -2,6 +2,7 @@ TESTDLL   = shdocvw.dll
 IMPORTS   = shell32 ole32 oleaut32 user32 gdi32 advapi32
 
 C_SRCS = \
+	ie.c \
 	intshcut.c \
 	shdocvw.c \
 	shortcut.c \
diff --git a/dlls/shdocvw/tests/ie.c b/dlls/shdocvw/tests/ie.c
new file mode 100644
index 0000000..e7b5ead
--- /dev/null
+++ b/dlls/shdocvw/tests/ie.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2011 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+
+#include <wine/test.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "ole2.h"
+#include "exdisp.h"
+
+static void test_InternetExplorer(void)
+{
+    IWebBrowser2 *wb;
+    IUnknown *unk;
+    ULONG ref;
+    HRESULT hres;
+
+    hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
+            &IID_IUnknown, (void**)&unk);
+    if(FAILED(hres)) {
+        win_skip("Could not create InternetExplorer object\n");
+        return;
+    }
+
+    hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
+    ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
+
+    IWebBrowser2_Release(wb);
+    ref = IUnknown_Release(unk);
+    ok(!ref, "object not destroyed, ref=%u\n", ref);
+}
+
+START_TEST(ie)
+{
+    CoInitialize(NULL);
+
+    test_InternetExplorer();
+
+    CoUninitialize();
+}




More information about the wine-cvs mailing list