summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-09 15:02:34 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-09 15:02:34 +0000
commitaffc827c82b455c4343b2f38087d587f7302e530 (patch)
tree81389cc1ae45cb4ef3a20bb882a498aeaa25e0ad
parent0f8171ef4747858c9702005cf73e4890e9cfb931 (diff)
downloadchromium_src-affc827c82b455c4343b2f38087d587f7302e530.zip
chromium_src-affc827c82b455c4343b2f38087d587f7302e530.tar.gz
chromium_src-affc827c82b455c4343b2f38087d587f7302e530.tar.bz2
Allow Chrome Frame test to run on Vista/IE7 at high integrity.
Bypass tricks to run IE in special ways if the tests are running at high integrity. Otherwise, the medium-integrity broker exits and low-integrity IE is therefore unable to get chrome_launcher running at medium integrity. BUG=60987 TEST=no manual testing needed; chrome_frame_tests.exe will either become better or worse. Review URL: http://codereview.chromium.org/9133001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116865 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 806904c..3324a0d 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,6 +16,7 @@
#include "base/file_version_info.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/process.h"
#include "base/process_util.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -361,13 +362,20 @@ HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser) {
HRESULT hr = S_OK;
DWORD cocreate_flags = CLSCTX_LOCAL_SERVER;
chrome_frame_test::LowIntegrityToken token;
+ base::IntegrityLevel integrity_level = base::INTEGRITY_UNKNOWN;
// Vista has a bug which manifests itself when a medium integrity process
// launches a COM server like IE which runs in protected mode due to UAC.
// This causes the IWebBrowser2 interface which is returned to be useless,
// i.e it does not receive any events, etc. Our workaround for this is
- // to impersonate a low integrity token and then launch IE.
+ // to impersonate a low integrity token and then launch IE. Skip this if the
+ // tests are running at high integrity, since the workaround results in the
+ // medium-integrity broker exiting, and the low-integrity IE is therefore
+ // unable to get chrome_launcher running at medium integrity.
if (base::win::GetVersion() == base::win::VERSION_VISTA &&
- GetInstalledIEVersion() == IE_7) {
+ GetInstalledIEVersion() == IE_7 &&
+ base::GetProcessIntegrityLevel(base::Process::Current().handle(),
+ &integrity_level) &&
+ integrity_level != base::HIGH_INTEGRITY) {
// Create medium integrity browser that will launch IE broker.
base::win::ScopedComPtr<IWebBrowser2> medium_integrity_browser;
hr = medium_integrity_browser.CreateInstance(CLSID_InternetExplorer, NULL,