Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: chrome/test/mini_installer_test/chrome_mini_installer.cc

Issue 8384002: Add test for Chrome install with existing Chrome Frame Multi-install (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/mini_installer_test/chrome_mini_installer.cc
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc
index 27a4227508fadf99d78784e71889e0a2324a8545..a145dd8b3a593f15dc8c150704d4f685e8f1797b 100644
--- a/chrome/test/mini_installer_test/chrome_mini_installer.cc
+++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc
@@ -183,7 +183,6 @@ void ChromeMiniInstaller::InstallMiniInstaller(bool over_install,
LOG(INFO) << "Install level is: "
<< (system_install_ ? "system" : "user");
RunInstaller(CommandLine(path));
-
std::string version;
ASSERT_TRUE(GetChromeVersionFromRegistry(&version))
<< "Install failed: unable to get version.";
@@ -202,7 +201,7 @@ CommandLine ChromeMiniInstaller::GetBaseMultiInstallCommand() {
void ChromeMiniInstaller::InstallChromeUsingMultiInstall() {
CommandLine cmd = GetBaseMultiInstallCommand();
cmd.AppendSwitch(installer::switches::kChrome);
- RunInstaller(cmd);
+ RunInstallerCommand(cmd);
// Verify installation.
InstallationValidator::InstallationType type =
@@ -216,7 +215,11 @@ void ChromeMiniInstaller::InstallChromeUsingMultiInstall() {
void ChromeMiniInstaller::InstallChromeFrameUsingMultiInstall() {
CommandLine cmd = GetBaseMultiInstallCommand();
- RunInstaller(cmd);
+ cmd.AppendSwitch(installer::switches::kDoNotCreateShortcuts);
+ cmd.AppendSwitch(installer::switches::kDoNotLaunchChrome);
+ cmd.AppendSwitch(installer::switches::kDoNotRegisterForUpdateLaunch);
+ cmd.AppendSwitch(installer::switches::kChromeFrame);
+ RunInstallerCommand(cmd);
// Verify installation.
InstallationValidator::InstallationType type =
@@ -241,7 +244,7 @@ void ChromeMiniInstaller::InstallChromeAndChromeFrame(bool ready_mode) {
cmd.AppendSwitch(installer::switches::kChromeFrame);
if (ready_mode)
cmd.AppendSwitch(installer::switches::kChromeFrameReadyMode);
- RunInstaller(cmd);
+ RunInstallerCommand(cmd);
// Verify installation.
InstallationValidator::InstallationType type =
installer::ExpectValidInstallation(system_install_);
@@ -353,7 +356,7 @@ void ChromeMiniInstaller::Repair(
std::string build_number;
ASSERT_TRUE(GetChromeVersionFromRegistry(&build_number));
FilePath install_path;
- ASSERT_TRUE(GetChromeInstallDirectoryLocation(&install_path));
+ ASSERT_TRUE(GetInstallDirectory(&install_path));
install_path = install_path.AppendASCII(build_number);
ASSERT_TRUE(file_util::Delete(install_path, true));
} else if (repair_type == ChromeMiniInstaller::REGISTRY) {
@@ -460,7 +463,7 @@ void ChromeMiniInstaller::UnInstallChromeFrameWithIERunning() {
void ChromeMiniInstaller::CleanChromeInstall() {
DeletePvRegistryKey();
FilePath install_path;
- ASSERT_TRUE(GetChromeInstallDirectoryLocation(&install_path));
+ ASSERT_TRUE(GetInstallDirectory(&install_path));
ASSERT_TRUE(file_util::Delete(install_path, true));
}
@@ -622,9 +625,9 @@ void ChromeMiniInstaller::FindChromeShortcut() {
}
}
-bool ChromeMiniInstaller::GetChromeInstallDirectoryLocation(FilePath* path) {
+bool ChromeMiniInstaller::GetInstallDirectory(FilePath* path) {
BrowserDistribution* dist = GetCurrentBrowserDistribution();
- *path = installer::GetChromeInstallPath(system_install_, dist);
+ *path = installer::GetChromeInstallPath(system_install_, dist);
FilePath parent;
if (system_install_) {
PathService::Get(base::DIR_PROGRAM_FILES, &parent);
@@ -678,6 +681,12 @@ void ChromeMiniInstaller::RunInstaller(const CommandLine& command) {
installer.AppendSwitch(installer::switches::kDoNotRegisterForUpdateLaunch);
installer.AppendSwitch(installer::switches::kChromeFrame);
}
+ RunInstallerCommand(installer);
+}
+
+void ChromeMiniInstaller::RunInstallerCommand(const CommandLine& command) {
+ ASSERT_TRUE(file_util::PathExists(command.GetProgram()));
+ CommandLine installer(command);
if (system_install_) {
installer.AppendSwitch(installer::switches::kSystemLevel);
}
@@ -696,7 +705,7 @@ void ChromeMiniInstaller::LaunchChrome(bool kill) {
MiniInstallerTestUtil::CloseProcesses(installer::kChromeExe);
FilePath install_path;
- ASSERT_TRUE(GetChromeInstallDirectoryLocation(&install_path));
+ ASSERT_TRUE(GetInstallDirectory(&install_path));
install_path = install_path.Append(installer::kChromeExe);
CommandLine browser(install_path);

Powered by Google App Engine
This is Rietveld 408576698