mshtml/tests: Fix htmldoc test on Windows Server and Win7.

This commit is contained in:
Ge van Geldorp 2009-09-23 12:37:28 +02:00 committed by Alexandre Julliard
parent 9cb140c43d
commit 73b3d35d05
5 changed files with 64 additions and 48 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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;