Ge van Geldorp : mshtml/tests: Fix htmldoc test on Windows Server and Win7.
Alexandre Julliard
julliard at winehq.org
Wed Sep 23 11:03:21 CDT 2009
Module: wine
Branch: master
Commit: 73b3d35d05992688e815237752a7f40700e5be87
URL: http://source.winehq.org/git/wine.git/?a=commit;h=73b3d35d05992688e815237752a7f40700e5be87
Author: Ge van Geldorp <ggeldorp at vmware.com>
Date: Wed Sep 23 12:37:28 2009 +0200
mshtml/tests: Fix htmldoc test on Windows Server and Win7.
---
dlls/mshtml/tests/dom.c | 22 +---------------------
dlls/mshtml/tests/htmldoc.c | 28 +++++++++++++++++++++++-----
dlls/mshtml/tests/mshtml_test.h | 38 ++++++++++++++++++++++++++++++++++++++
dlls/mshtml/tests/script.c | 22 +---------------------
dlls/urlmon/tests/sec_mgr.c | 2 +-
5 files changed, 64 insertions(+), 48 deletions(-)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index b489ce0..fd7cc44 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -31,6 +31,7 @@
#include "mshtmhst.h"
#include "docobj.h"
#include "dispex.h"
+#include "mshtml_test.h"
static const char doc_blank[] = "<html></html>";
static const char doc_str1[] = "<html><body>test</body></html>";
@@ -5394,27 +5395,6 @@ static void gecko_installer_workaround(BOOL disable)
RegCloseKey(hkey);
}
-/* Check if Internet Explorer is configured to run in "Enhanced Security Configuration" (aka hardened mode) */
-/* Note: this code is duplicated in dlls/mshtml/tests/dom.c, dlls/mshtml/tests/script.c and dlls/urlmon/tests/sec_mgr.c */
-static BOOL is_ie_hardened(void)
-{
- HKEY zone_map;
- DWORD ie_harden, type, size;
-
- ie_harden = 0;
- if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
- 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
- size = sizeof(DWORD);
- if (RegQueryValueEx(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
- type != REG_DWORD) {
- ie_harden = 0;
- }
- RegCloseKey(zone_map);
- }
-
- return ie_harden != 0;
-}
-
START_TEST(dom)
{
gecko_installer_workaround(TRUE);
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 1eb0cea..7a4d5ee 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -37,6 +37,7 @@
#include "idispids.h"
#include "shlguid.h"
#include "perhist.h"
+#include "mshtml_test.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(IID_IProxyManager,0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
@@ -104,6 +105,7 @@ DEFINE_EXPECT(Exec_ShellDocView_37);
DEFINE_EXPECT(Exec_ShellDocView_84);
DEFINE_EXPECT(Exec_ShellDocView_103);
DEFINE_EXPECT(Exec_ShellDocView_105);
+DEFINE_EXPECT(Exec_ShellDocView_140);
DEFINE_EXPECT(Exec_UPDATECOMMANDS);
DEFINE_EXPECT(Exec_SETTITLE);
DEFINE_EXPECT(Exec_HTTPEQUIV);
@@ -2310,6 +2312,14 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
return E_NOTIMPL;
+ case 140:
+ CHECK_EXPECT2(Exec_ShellDocView_140);
+
+ ok(pvaIn == NULL, "pvaIn != NULL\n");
+ ok(pvaOut == NULL, "pvaOut != NULL\n");
+
+ return E_NOTIMPL;
+
default:
ok(0, "unexpected command %d\n", nCmdID);
return E_FAIL;
@@ -2499,9 +2509,10 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
static IServiceProvider ServiceProvider = { &ServiceProviderVtbl };
DEFINE_GUID(IID_unk1, 0xD48A6EC6,0x6A4A,0x11CF,0x94,0xA7,0x44,0x45,0x53,0x54,0x00,0x00); /* HTMLWindow2 ? */
-DEFINE_GUID(IID_unk2, 0x7BB0B520,0xB1A7,0x11D2,0xBB,0x23,0x00,0xC0,0x4F,0x79,0xAB,0xCD);
-DEFINE_GUID(IID_unk3, 0x000670BA,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
+DEFINE_GUID(IID_IThumbnailView, 0x7BB0B520,0xB1A7,0x11D2,0xBB,0x23,0x00,0xC0,0x4F,0x79,0xAB,0xCD);
+DEFINE_GUID(IID_IRenMailEditor, 0x000670BA,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(IID_unk4, 0x305104a6,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
+DEFINE_GUID(IID_IDocHostUIHandlerPriv, 0xf0d241d1,0x5d0e,0x4e85,0xbc,0xb4,0xfa,0xd7,0xf7,0xc5,0x52,0x8c);
static HRESULT QueryInterface(REFIID riid, void **ppv)
{
@@ -2533,12 +2544,14 @@ static HRESULT QueryInterface(REFIID riid, void **ppv)
return E_NOINTERFACE; /* ? */
else if(IsEqualGUID(&IID_unk1, riid))
return E_NOINTERFACE; /* HTMLWindow2 ? */
- else if(IsEqualGUID(&IID_unk2, riid))
+ else if(IsEqualGUID(&IID_IThumbnailView, riid))
return E_NOINTERFACE; /* ? */
- else if(IsEqualGUID(&IID_unk3, riid))
+ else if(IsEqualGUID(&IID_IRenMailEditor, riid))
return E_NOINTERFACE; /* ? */
else if(IsEqualGUID(&IID_unk4, riid))
return E_NOINTERFACE; /* ? */
+ else if(IsEqualGUID(&IID_IDocHostUIHandlerPriv, riid))
+ return E_NOINTERFACE; /* ? */
else
ok(0, "unexpected riid %s\n", debugstr_guid(riid));
@@ -2811,6 +2824,7 @@ static void test_download(DWORD flags)
SET_EXPECT(Exec_SETDOWNLOADSTATE_0);
SET_EXPECT(Exec_ShellDocView_103);
SET_EXPECT(Exec_ShellDocView_105);
+ SET_EXPECT(Exec_ShellDocView_140);
SET_EXPECT(Exec_MSHTML_PARSECOMPLETE);
SET_EXPECT(Exec_HTTPEQUIV_DONE);
SET_EXPECT(SetStatusText);
@@ -2870,6 +2884,7 @@ static void test_download(DWORD flags)
CHECK_CALLED(Exec_SETDOWNLOADSTATE_0);
SET_CALLED(Exec_ShellDocView_103);
SET_CALLED(Exec_ShellDocView_105);
+ SET_CALLED(Exec_ShellDocView_140);
CHECK_CALLED(Exec_MSHTML_PARSECOMPLETE);
CHECK_CALLED(Exec_HTTPEQUIV_DONE);
SET_CALLED(SetStatusText);
@@ -4030,7 +4045,10 @@ static void test_HTMLDocument_http(void)
return;
}
- test_download(DWL_HTTP);
+ if (winetest_interactive || ! is_ie_hardened())
+ test_download(DWL_HTTP);
+ else
+ win_skip("IE running in Enhanced Security Configuration\n");
test_IsDirty(unk, S_FALSE);
test_MSHTML_QueryStatus(unk, OLECMDF_SUPPORTED);
diff --git a/dlls/mshtml/tests/mshtml_test.h b/dlls/mshtml/tests/mshtml_test.h
new file mode 100644
index 0000000..7768f75
--- /dev/null
+++ b/dlls/mshtml/tests/mshtml_test.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009 Ge van Geldorp
+ *
+ * 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
+ */
+
+/* Check if Internet Explorer is configured to run in "Enhanced Security Configuration" (aka hardened mode) */
+/* Note: this code is duplicated in dlls/mshtml/tests/mshtml_test.h and dlls/urlmon/tests/sec_mgr.c */
+static BOOL is_ie_hardened(void)
+{
+ HKEY zone_map;
+ DWORD ie_harden, type, size;
+
+ ie_harden = 0;
+ if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
+ 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
+ size = sizeof(DWORD);
+ if (RegQueryValueEx(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
+ type != REG_DWORD) {
+ ie_harden = 0;
+ }
+ RegCloseKey(zone_map);
+ }
+
+ return ie_harden != 0;
+}
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index bc140bd..a4ef3d0 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -33,6 +33,7 @@
#include "activdbg.h"
#include "objsafe.h"
#include "mshtmdid.h"
+#include "mshtml_test.h"
DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
@@ -1404,27 +1405,6 @@ static void gecko_installer_workaround(BOOL disable)
RegCloseKey(hkey);
}
-/* Check if Internet Explorer is configured to run in "Enhanced Security Configuration" (aka hardened mode) */
-/* Note: this code is duplicated in dlls/mshtml/tests/dom.c, dlls/mshtml/tests/script.c and dlls/urlmon/tests/sec_mgr.c */
-static BOOL is_ie_hardened(void)
-{
- HKEY zone_map;
- DWORD ie_harden, type, size;
-
- ie_harden = 0;
- if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap",
- 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
- size = sizeof(DWORD);
- if (RegQueryValueEx(zone_map, "IEHarden", NULL, &type, (LPBYTE) &ie_harden, &size) != ERROR_SUCCESS ||
- type != REG_DWORD) {
- ie_harden = 0;
- }
- RegCloseKey(zone_map);
- }
-
- return ie_harden != 0;
-}
-
START_TEST(script)
{
gecko_installer_workaround(TRUE);
diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c
index e607259..9d9e19c 100644
--- a/dlls/urlmon/tests/sec_mgr.c
+++ b/dlls/urlmon/tests/sec_mgr.c
@@ -168,7 +168,7 @@ static void test_SecurityManager(void)
}
/* Check if Internet Explorer is configured to run in "Enhanced Security Configuration" (aka hardened mode) */
-/* Note: this code is duplicated in dlls/mshtml/tests/dom.c, dlls/mshtml/tests/script.c and dlls/urlmon/tests/sec_mgr.c */
+/* Note: this code is duplicated in dlls/mshtml/tests/mshtml_test.h and dlls/urlmon/tests/sec_mgr.c */
static BOOL is_ie_hardened(void)
{
HKEY zone_map;
More information about the wine-cvs
mailing list