diff options
author | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 23:54:34 +0000 |
---|---|---|
committer | slightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 23:54:34 +0000 |
commit | 11903b0dd26e51563e0645af2e900649ac028408 (patch) | |
tree | e544522a8295325407938d998b09a8dcc996ea03 /chrome_frame | |
parent | 5607c4eb42ea5b5f153b7dfcbe0dddd08cf1aa4e (diff) | |
download | chromium_src-11903b0dd26e51563e0645af2e900649ac028408.zip chromium_src-11903b0dd26e51563e0645af2e900649ac028408.tar.gz chromium_src-11903b0dd26e51563e0645af2e900649ac028408.tar.bz2 |
Fixes GCF perf tests in prep for re-enabling them on the bots.
BUG=36734
TEST=build/run chrome_frame_perftests.exe, note that they all run now
Review URL: http://codereview.chromium.org/1433002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/bho.cc | 7 | ||||
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 43 | ||||
-rw-r--r-- | chrome_frame/test_utils.cc | 34 | ||||
-rw-r--r-- | chrome_frame/test_utils.h | 1 | ||||
-rw-r--r-- | chrome_frame/utils.cc | 9 | ||||
-rw-r--r-- | chrome_frame/utils.h | 5 |
6 files changed, 48 insertions, 51 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc index f685166..5118750 100644 --- a/chrome_frame/bho.cc +++ b/chrome_frame/bho.cc @@ -316,9 +316,10 @@ bool PatchHelper::InitializeAndPatchProtocolsIfNeeded() { _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); if (state_ == UNKNOWN) { - // If we're going to start patching things, we'd better make sure that we - // stick around for ever more: - PinModule(); + // If we're going to start patching things for reals, we'd better make sure + // that we stick around for ever more: + if (!IsUnpinnedMode()) + PinModule(); HttpNegotiatePatch::Initialize(); diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index 1627b13..2433239 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -281,16 +281,20 @@ class ChromeFrameStartupTest : public ChromeFramePerfTestBase { ChromeFrameStartupTest() {} virtual void SetUp() { + SetConfigBool(kChromeFrameUnpinnedMode, true); ASSERT_TRUE(PathService::Get(chrome::DIR_APP, &dir_app_)); chrome_dll_ = dir_app_.Append(FILE_PATH_LITERAL("chrome.dll")); chrome_exe_ = dir_app_.Append( FilePath::FromWStringHack(chrome::kBrowserProcessExecutableName)); chrome_frame_dll_ = dir_app_.Append(FILE_PATH_LITERAL("servers")); - chrome_frame_dll_ = dir_app_.Append( + chrome_frame_dll_ = chrome_frame_dll_.Append( FilePath::FromWStringHack(kChromeFrameDllName)); + DLOG(INFO) << __FUNCTION__ << ": " << chrome_frame_dll_.value(); + } + virtual void TearDown() { + DeleteConfigValue(kChromeFrameUnpinnedMode); } - virtual void TearDown() {} // TODO(iyengar) // This function is similar to the RunStartupTest function used in chrome @@ -430,8 +434,10 @@ class ChromeFrameStartupTestActiveXReference chrome_frame_registrar_->RegisterReferenceChromeFrameBuild(); ChromeFrameStartupTest::SetUp(); - chrome_frame_dll_ = FilePath::FromWStringHack( - chrome_frame_registrar_->GetChromeFrameDllPath()); + + chrome_frame_dll_ = FilePath( + chrome_frame_registrar_->GetReferenceChromeFrameDllPath()); + DLOG(INFO) << __FUNCTION__ << ": " << chrome_frame_dll_.value(); } virtual void TearDown() { @@ -582,35 +588,6 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase { return true; } - // Returns the path of the current chrome.exe being used by this test. - // This could return the regular chrome path or that of the reference - // build. - std::wstring GetChromeExePath() { - std::wstring chrome_exe_path = - chrome_frame_registrar_->GetChromeFrameDllPath(); - EXPECT_FALSE(chrome_exe_path.empty()); - - file_util::UpOneDirectory(&chrome_exe_path); - - std::wstring chrome_exe_test_path = chrome_exe_path; - file_util::AppendToPath(&chrome_exe_test_path, - chrome::kBrowserProcessExecutableName); - - if (!file_util::PathExists( - FilePath::FromWStringHack(chrome_exe_test_path))) { - file_util::UpOneDirectory(&chrome_exe_path); - - chrome_exe_test_path = chrome_exe_path; - file_util::AppendToPath(&chrome_exe_test_path, - chrome::kBrowserProcessExecutableName); - } - - EXPECT_TRUE( - file_util::PathExists(FilePath::FromWStringHack(chrome_exe_test_path))); - - return chrome_exe_path; - } - void InitiateNextNavigation() { // Get the memory consumption information for the child processes // of the chrome browser. diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc index e87c4bb..e1d33fe 100644 --- a/chrome_frame/test_utils.cc +++ b/chrome_frame/test_utils.cc @@ -20,6 +20,7 @@ #include "testing/gtest/include/gtest/gtest.h" const wchar_t kChromeFrameDllName[] = L"npchrome_frame.dll"; +const wchar_t kReferenceChromeFrameDllName[] = L"npchrome_tab.dll"; // Statics FilePath ScopedChromeFrameRegistrar::GetChromeFrameBuildPath() { @@ -72,6 +73,23 @@ void ScopedChromeFrameRegistrar::RegisterAtPath( ASSERT_TRUE(FreeLibrary(chrome_frame_dll_handle)); } +std::wstring ScopedChromeFrameRegistrar::GetReferenceChromeFrameDllPath() { + std::wstring reference_build_dir; + PathService::Get(chrome::DIR_APP, &reference_build_dir); + + file_util::UpOneDirectory(&reference_build_dir); + file_util::UpOneDirectory(&reference_build_dir); + + file_util::AppendToPath(&reference_build_dir, L"chrome_frame"); + file_util::AppendToPath(&reference_build_dir, L"tools"); + file_util::AppendToPath(&reference_build_dir, L"test"); + file_util::AppendToPath(&reference_build_dir, L"reference_build"); + file_util::AppendToPath(&reference_build_dir, L"chrome"); + file_util::AppendToPath(&reference_build_dir, L"servers"); + file_util::AppendToPath(&reference_build_dir, kReferenceChromeFrameDllName); + return reference_build_dir; +} + // Non-statics ScopedChromeFrameRegistrar::ScopedChromeFrameRegistrar( @@ -98,21 +116,7 @@ void ScopedChromeFrameRegistrar::RegisterChromeFrameAtPath( } void ScopedChromeFrameRegistrar::RegisterReferenceChromeFrameBuild() { - std::wstring reference_build_dir; - ASSERT_TRUE(PathService::Get(chrome::DIR_APP, &reference_build_dir)); - - file_util::UpOneDirectory(&reference_build_dir); - file_util::UpOneDirectory(&reference_build_dir); - - file_util::AppendToPath(&reference_build_dir, L"chrome"); - file_util::AppendToPath(&reference_build_dir, L"tools"); - file_util::AppendToPath(&reference_build_dir, L"test"); - file_util::AppendToPath(&reference_build_dir, L"reference_build"); - file_util::AppendToPath(&reference_build_dir, L"chrome_frame"); - file_util::AppendToPath(&reference_build_dir, L"servers"); - file_util::AppendToPath(&reference_build_dir, kChromeFrameDllName); - - RegisterChromeFrameAtPath(reference_build_dir); + RegisterChromeFrameAtPath(GetReferenceChromeFrameDllPath()); } std::wstring ScopedChromeFrameRegistrar::GetChromeFrameDllPath() const { diff --git a/chrome_frame/test_utils.h b/chrome_frame/test_utils.h index f3ad937..a342a6c 100644 --- a/chrome_frame/test_utils.h +++ b/chrome_frame/test_utils.h @@ -36,6 +36,7 @@ class ScopedChromeFrameRegistrar { static FilePath GetChromeFrameBuildPath(); static void RegisterAtPath(const std::wstring& path); static void RegisterDefaults(); + static std::wstring GetReferenceChromeFrameDllPath(); private: // Contains the path of the most recently registered Chrome Frame DLL. diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 85d4880..3065c54 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -61,6 +61,10 @@ const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; // are handled by the chrome test crash server. const wchar_t kChromeFrameHeadlessMode[] = L"ChromeFrameHeadlessMode"; +// Indicates that we are running in an environment that wishes to avoid +// DLL pinning, such as the perf tests. +const wchar_t kChromeFrameUnpinnedMode[] = L"kChromeFrameUnpinnedMode"; + // {1AF32B6C-A3BA-48B9-B24E-8AA9C41F6ECD} static const IID IID_IWebBrowserPriv2IE7 = { 0x1AF32B6C, 0xA3BA, 0x48B9, { 0xB2, 0x4E, 0x8A, 0xA9, 0xC4, 0x1F, 0x6E, 0xCD } }; @@ -879,6 +883,11 @@ bool IsHeadlessMode() { return headless; } +bool IsUnpinnedMode() { + bool unpinned = GetConfigBool(false, kChromeFrameUnpinnedMode); + return unpinned; +} + std::wstring GetActualUrlFromMoniker(IMoniker* moniker, IBindCtx* bind_context, const std::wstring& bho_url) { diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index ffa4b08..bf8a33ec 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -24,6 +24,7 @@ extern const wchar_t kChromeContentPrefix[]; extern const wchar_t kChromeProtocolPrefix[]; extern const wchar_t kChromeFrameHeadlessMode[]; +extern const wchar_t kChromeFrameUnpinnedMode[]; extern const wchar_t kEnableGCFProtocol[]; extern const wchar_t kChromeMimeType[]; @@ -223,6 +224,10 @@ bool DeleteConfigValue(const wchar_t* value_name); // gather crash dumps, etc to send them to the crash server. bool IsHeadlessMode(); +// Returns true if we are running in unpinned mode in which case DLL +// eviction should be possible. +bool IsUnpinnedMode(); + // Check if this url is opting into Chrome Frame based on static settings. bool IsOptInUrl(const wchar_t* url); |