summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test_utils.cc
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 19:46:26 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 19:46:26 +0000
commit99372841aea3f058340e82a09c7f0d64a7d9ed47 (patch)
treecfe1c76fcfed564131432222d626edef7debbca0 /chrome_frame/test_utils.cc
parent5561a2f81f61f37604552f6c36c2d5b1a52336af (diff)
downloadchromium_src-99372841aea3f058340e82a09c7f0d64a7d9ed47.zip
chromium_src-99372841aea3f058340e82a09c7f0d64a7d9ed47.tar.gz
chromium_src-99372841aea3f058340e82a09c7f0d64a7d9ed47.tar.bz2
Remove the \servers build output directory and place Chrome Frame parts into the root output folder next to chrome.exe et al.
Also add a more helpful error message when failing to register the Chrome Frame dll. Review URL: http://codereview.chromium.org/8013001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test_utils.cc')
-rw-r--r--chrome_frame/test_utils.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc
index f90db60..8a1c380 100644
--- a/chrome_frame/test_utils.cc
+++ b/chrome_frame/test_utils.cc
@@ -29,8 +29,7 @@ FilePath GetChromeFrameBuildPath() {
FilePath build_path;
PathService::Get(chrome::DIR_APP, &build_path);
- FilePath dll_path = build_path.Append(L"servers").
- Append(kChromeFrameDllName);
+ FilePath dll_path = build_path.Append(kChromeFrameDllName);
if (!file_util::PathExists(dll_path)) {
// Well, dang.. try looking in the current directory.
@@ -45,7 +44,7 @@ FilePath GetChromeFrameBuildPath() {
return dll_path;
}
-bool ScopedChromeFrameRegistrar::register_chrome_path_provider_ = false;;
+bool ScopedChromeFrameRegistrar::register_chrome_path_provider_ = false;
// static
void ScopedChromeFrameRegistrar::RegisterDefaults() {
@@ -53,8 +52,6 @@ void ScopedChromeFrameRegistrar::RegisterDefaults() {
chrome::RegisterPathProvider();
register_chrome_path_provider_ = true;
}
- FilePath dll_path = GetChromeFrameBuildPath();
- RegisterAtPath(dll_path.value(), chrome_frame_test::GetTestBedType());
}
// static
@@ -63,7 +60,8 @@ void ScopedChromeFrameRegistrar::RegisterAtPath(
ASSERT_FALSE(path.empty());
HMODULE dll_handle = LoadLibrary(path.c_str());
- ASSERT_TRUE(dll_handle != NULL);
+ ASSERT_TRUE(dll_handle != NULL) << "Failed to load " << path
+ << " , gle = " << GetLastError();
typedef HRESULT (STDAPICALLTYPE* DllRegisterServerFn)();
DllRegisterServerFn register_server = NULL;
@@ -76,9 +74,14 @@ void ScopedChromeFrameRegistrar::RegisterAtPath(
dll_handle, "DllRegisterServer"));
}
ASSERT_TRUE(register_server != NULL);
- EXPECT_HRESULT_SUCCEEDED((*register_server)());
-
+ HRESULT reg_result = (*register_server)();
ASSERT_TRUE(FreeLibrary(dll_handle));
+
+ // Assert here after the FreeLibrary since otherwise we hit a
+ // multiple AtExitMananger crash for modules that use base.
+ ASSERT_HRESULT_SUCCEEDED(reg_result) << "Failed to register DLL at "
+ << path
+ << " , are you running as Admin?";
}
// static