diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-01 06:00:25 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-01 06:00:25 +0000 |
commit | bf6117c7e9b66f3648af83c047a3428d66353451 (patch) | |
tree | 42d42291596c7b70ff1bdace230473277d5a1cd5 /chrome_frame | |
parent | 8a0989f01fff18edb0f56dcc06db2742eb6a1dcb (diff) | |
download | chromium_src-bf6117c7e9b66f3648af83c047a3428d66353451.zip chromium_src-bf6117c7e9b66f3648af83c047a3428d66353451.tar.gz chromium_src-bf6117c7e9b66f3648af83c047a3428d66353451.tar.bz2 |
Refactor the installer to support multi-install.
The installer now does its work based on distributions and target installation paths.
Each distribution has exactly one target installation path but each installation path can have more than one distribution.
In the absense of the --multi-install switch, the installer should continue to work as before.
The biggest difference here is that we don't rely on a single global distribution object that controls the entire installation flow and we have a few classes for the new abstractions instead of global functions.
It's far from perfect, but it's a step towards separating the core file package required for all distributions from the distributions themselves.
Additionally, there are tons of little changes here such as consistant usage of FilePath and CommandLine instead of mixing them with std::wstring.
TEST=Install, uninstall, upgrade, etc. Everything install related.
BUG=61609
Review URL: http://codereview.chromium.org/5172011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/test_with_web_server.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index a030a76..8d4e3ba 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -8,9 +8,11 @@ #include "base/file_version_info.h" #include "base/path_service.h" #include "base/stringprintf.h" +#include "base/test/test_timeouts.h" #include "base/utf_string_conversions.h" #include "base/win/windows_version.h" #include "chrome/common/chrome_switches.h" +#include "chrome/installer/util/product.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/helper.h" #include "chrome_frame/html_utils.h" @@ -26,8 +28,6 @@ using testing::_; using testing::StrCaseEq; const wchar_t kDocRoot[] = L"chrome_frame\\test\\data"; -const int kLongWaitTimeout = 15 * 1000; -const int kShortWaitTimeout = 5 * 1000; namespace { @@ -92,7 +92,7 @@ void ChromeFrameTestWithWebServer::SetUp() { // Make sure our playground is clean before we start. CloseAllBrowsers(); - // Make sure that we are not accidently enabling gcf protocol. + // Make sure that we are not accidentally enabling gcf protocol. SetConfigBool(kAllowUnsafeURLs, false); FilePath chrome_frame_source_path; @@ -220,7 +220,7 @@ void ChromeFrameTestWithWebServer::SimpleBrowserTestExpectedResult( ASSERT_TRUE(LaunchBrowser(browser, page)); server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE), kPostedResultSubstring); - WaitForTestToComplete(kLongWaitTimeout); + WaitForTestToComplete(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ(result, server_mock_.posted_result()); } @@ -237,7 +237,7 @@ void ChromeFrameTestWithWebServer::OptionalBrowserTest(BrowserKind browser, } else { server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE), kPostedResultSubstring); - WaitForTestToComplete(kLongWaitTimeout); + WaitForTestToComplete(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ("OK", server_mock_.posted_result()); } } @@ -259,15 +259,17 @@ void ChromeFrameTestWithWebServer::VersionTest(BrowserKind browser, // If we can't find the Chrome Frame DLL in the src tree, we turn to // the directory where chrome is installed. if (!version_info) { - installer::Version* ver_system = InstallUtil::GetChromeVersion(true); - installer::Version* ver_user = InstallUtil::GetChromeVersion(false); - ASSERT_TRUE(ver_system || ver_user); - - bool system_install = ver_system ? true : false; - FilePath cf_dll_path = FilePath::FromWStringHack( - installer::GetChromeInstallPath(system_install)); + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + scoped_ptr<installer::Version> ver_system( + InstallUtil::GetChromeVersion(dist, true)); + scoped_ptr<installer::Version> ver_user( + InstallUtil::GetChromeVersion(dist, false)); + ASSERT_TRUE(ver_system.get() || ver_user.get()); + + bool system_install = ver_system.get() ? true : false; + FilePath cf_dll_path(installer::GetChromeInstallPath(system_install, dist)); cf_dll_path = cf_dll_path.Append( - ver_system ? ver_system->GetString() : ver_user->GetString()); + ver_system.get() ? ver_system->GetString() : ver_user->GetString()); cf_dll_path = cf_dll_path.Append(kChromeFrameDllName); version_info = FileVersionInfo::CreateFileVersionInfo(cf_dll_path); if (version_info) @@ -281,7 +283,7 @@ void ChromeFrameTestWithWebServer::VersionTest(BrowserKind browser, EXPECT_TRUE(LaunchBrowser(browser, page)); server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE), kPostedResultSubstring); - WaitForTestToComplete(kLongWaitTimeout); + WaitForTestToComplete(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ(version, UTF8ToWide(server_mock_.posted_result())); } @@ -294,7 +296,7 @@ void ChromeFrameTestWithWebServer::SessionIdTest(BrowserKind browser, server_mock_.set_expected_result(expected_result); server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE), kPostedResultSubstring); - WaitForTestToComplete(kLongWaitTimeout); + WaitForTestToComplete(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ(expected_result, server_mock_.posted_result()); } @@ -489,7 +491,7 @@ TEST_F(ChromeFrameTestWithWebServer, DISABLED_WidgetModeOpera_ObjectFocus) { if (!LaunchBrowser(OPERA, kNavigateSimpleObjectFocus)) { LOG(ERROR) << "Failed to launch browser " << ToString(OPERA); } else { - ASSERT_TRUE(WaitForOnLoad(kLongWaitTimeout)); + ASSERT_TRUE(WaitForOnLoad(TestTimeouts::action_max_timeout_ms())); server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE), kPostedResultSubstring); BringBrowserToTop(); |