summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 21:03:15 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 21:03:15 +0000
commit59eb1f713df4582c9c4431d4ee11d234bc5cc5cc (patch)
tree217b84483468f1373e36c5580f9208a6ab45924e
parent4e4719c78db3eeb6891525970cc7e32d5bc36670 (diff)
downloadchromium_src-59eb1f713df4582c9c4431d4ee11d234bc5cc5cc.zip
chromium_src-59eb1f713df4582c9c4431d4ee11d234bc5cc5cc.tar.gz
chromium_src-59eb1f713df4582c9c4431d4ee11d234bc5cc5cc.tar.bz2
Review URL: http://codereview.chromium.org/3163040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58400 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/mini_installer_test/chrome_mini_installer.cc59
-rw-r--r--chrome/test/mini_installer_test/mini_installer_test_constants.cc4
-rw-r--r--chrome/test/mini_installer_test/mini_installer_test_constants.h2
-rw-r--r--chrome/test/mini_installer_test/mini_installer_test_util.cc12
-rw-r--r--chrome/test/mini_installer_test/test.cc12
5 files changed, 44 insertions, 45 deletions
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc
index 9be3a24..b1ba240 100644
--- a/chrome/test/mini_installer_test/chrome_mini_installer.cc
+++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc
@@ -40,17 +40,10 @@ void ChromeMiniInstaller::SetBuildUnderTest(const std::wstring& build) {
else
build_prefix = build.c_str();
- std::wstring full_installer_pattern;
- if (is_chrome_frame_)
- full_installer_pattern =
- mini_installer_constants::kChromeFrameFullInstallerPattern;
- else
- full_installer_pattern = mini_installer_constants::kFullInstallerPattern;
-
// Do not fail here if cannot find the installer. Set the bool and allow
// to fail in the particular test.
has_full_installer_ = MiniInstallerTestUtil::GetInstaller(
- full_installer_pattern.c_str(),
+ mini_installer_constants::kFullInstallerPattern,
&full_installer_, build_prefix, is_chrome_frame_);
has_diff_installer_ = MiniInstallerTestUtil::GetInstaller(
mini_installer_constants::kDiffInstallerPattern,
@@ -207,8 +200,13 @@ void ChromeMiniInstaller::OverInstall() {
void ChromeMiniInstaller::Repair(
ChromeMiniInstaller::RepairChrome repair_type) {
InstallFullInstaller(false);
+ if (is_chrome_frame_) {
+ MiniInstallerTestUtil::CloseProcesses(
+ mini_installer_constants::kIEProcessName);
+ } else {
+ MiniInstallerTestUtil::CloseProcesses(installer_util::kNaClExe);
+ }
MiniInstallerTestUtil::CloseProcesses(installer_util::kChromeExe);
- MiniInstallerTestUtil::CloseProcesses(installer_util::kNaClExe);
if (repair_type == ChromeMiniInstaller::VERSION_FOLDER) {
DeleteFolder(L"version_folder");
printf("Deleted folder. Now trying to launch chrome\n");
@@ -245,10 +243,13 @@ void ChromeMiniInstaller::UnInstall() {
printf("%ls is not installed.\n", product_name.c_str());
return;
}
- if (is_chrome_frame_)
- MiniInstallerTestUtil::CloseProcesses(L"IEXPLORE.EXE");
+ if (is_chrome_frame_) {
+ MiniInstallerTestUtil::CloseProcesses(
+ mini_installer_constants::kIEProcessName);
+ } else {
+ MiniInstallerTestUtil::CloseProcesses(installer_util::kNaClExe);
+ }
MiniInstallerTestUtil::CloseProcesses(installer_util::kChromeExe);
- MiniInstallerTestUtil::CloseProcesses(installer_util::kNaClExe);
std::wstring uninstall_path = GetUninstallPath();
if (uninstall_path == L"") {
printf("\n %ls install is in a weird state. Cleaning the machine...\n",
@@ -301,14 +302,16 @@ bool ChromeMiniInstaller::CloseUninstallWindow() {
timer = timer + 200;
}
- if (hndl == NULL)
- hndl = FindWindow(NULL, mini_installer_constants::kChromeBuildType);
+ if (!is_chrome_frame_) {
+ if (hndl == NULL)
+ hndl = FindWindow(NULL, mini_installer_constants::kChromeBuildType);
- if (hndl == NULL)
- return false;
+ if (hndl == NULL)
+ return false;
- SetForegroundWindow(hndl);
- MiniInstallerTestUtil::SendEnterKeyToWindow();
+ SetForegroundWindow(hndl);
+ MiniInstallerTestUtil::SendEnterKeyToWindow();
+ }
return true;
}
@@ -379,20 +382,24 @@ bool ChromeMiniInstaller::CheckRegistryKeyOnUninstall(
// Deletes Installer folder from Applications directory.
void ChromeMiniInstaller::DeleteFolder(const wchar_t* folder_name) {
FilePath install_path(GetChromeInstallDirectoryLocation());
+ std::wstring temp_chrome_dir;
+ if (is_chrome_frame_) {
+ temp_chrome_dir = mini_installer_constants::kChromeFrameAppDir;
+ } else {
+ temp_chrome_dir = mini_installer_constants::kChromeAppDir;
+ }
+
if (wcscmp(folder_name, L"version_folder") == 0) {
- std::wstring delete_path;
- delete_path = mini_installer_constants::kChromeAppDir;
std::wstring build_number;
GetChromeVersionFromRegistry(&build_number);
- delete_path = delete_path + build_number;
- install_path = install_path.Append(delete_path);
- } else if (wcscmp(folder_name,
- mini_installer_constants::kChromeAppDir) == 0) {
+ temp_chrome_dir = temp_chrome_dir + build_number;
+ install_path = install_path.Append(temp_chrome_dir);
+ } else if (wcscmp(folder_name, temp_chrome_dir.c_str()) == 0) {
install_path = install_path.Append(folder_name).StripTrailingSeparators();
}
printf("This path will be deleted: %ls\n", install_path.value().c_str());
ASSERT_TRUE(file_util::Delete(install_path, true));
-}
+ }
// Will delete user data profile.
void ChromeMiniInstaller::DeleteUserDataFolder() {
@@ -601,7 +608,7 @@ void ChromeMiniInstaller::VerifyChromeFrameInstall() {
}
// Launch IE
- LaunchBrowser(browser_path, L"cf:about:version",
+ LaunchBrowser(browser_path, L"gcf:about:version",
mini_installer_constants::kIEProcessName,
true);
diff --git a/chrome/test/mini_installer_test/mini_installer_test_constants.cc b/chrome/test/mini_installer_test/mini_installer_test_constants.cc
index ed4a289..da682e6 100644
--- a/chrome/test/mini_installer_test/mini_installer_test_constants.cc
+++ b/chrome/test/mini_installer_test/mini_installer_test_constants.cc
@@ -25,7 +25,6 @@ const wchar_t kBrowserAppName[] = L"Google - Google Chrome";
const wchar_t kBrowserTabName[] = L"New Tab - Google Chrome";
const wchar_t kChromeFrameAppDir[] = L"Google\\Chrome Frame\\Application\\";
const wchar_t kChromeFrameAppName[] = L"Google Chrome Frame";
-const wchar_t kChromeFrameFullInstallerPattern[] = L"_chromeframe_installer";
const wchar_t kChromeFrameProductName[] = L"Chrome Frame";
const wchar_t kChromeMiniInstallerExecutable[] = L"mini_installer.exe";
const wchar_t kChromeMetaInstallerExecutable[] = L"chrome_installer.exe";
@@ -43,6 +42,7 @@ const wchar_t kStandaloneInstaller[] = L"ChromeSetupTest.exe";
const wchar_t kSystemInstall[] = L"system";
const wchar_t kUserInstall[] = L"user";
const wchar_t kUntaggedInstallerPattern[] = L"ChromeStandaloneSetup_";
+const wchar_t kWinFolder[] = L"win";
const wchar_t kDevChannelBuild[] = L"3.0.";
@@ -64,5 +64,5 @@ const wchar_t kChromeApplyTagExe[] =
const wchar_t kChromeApplyTagParameters[] =
L"\"appguid={8A69D345-D564-463C-AFF1-A69D9E530F96}&appname=Chrome&needsadmin=false\"";
const wchar_t kChromeDiffInstallerLocation[] =
- L"\\\\172.24.6.7\\shares\\googleclient\\save\\builds\\chrome\\";
+ L"\\\\172.24.6.7\\shares\\chromeclient\\builds\\chrome\\";
}
diff --git a/chrome/test/mini_installer_test/mini_installer_test_constants.h b/chrome/test/mini_installer_test/mini_installer_test_constants.h
index bb8ad2c..8faf010 100644
--- a/chrome/test/mini_installer_test/mini_installer_test_constants.h
+++ b/chrome/test/mini_installer_test/mini_installer_test_constants.h
@@ -13,7 +13,6 @@ namespace mini_installer_constants {
// Path and process names
extern const wchar_t kChromeAppDir[];
extern const wchar_t kChromeFrameAppDir[];
-extern const wchar_t kChromeFrameFullInstallerPattern[];
extern const wchar_t kChromeFrameProductName[];
extern const wchar_t kChromeMetaInstallerExecutable[];
extern const wchar_t kChromeMiniInstallerExecutable[];
@@ -29,6 +28,7 @@ extern const wchar_t kGoogleUpdateExecutable[];
extern const wchar_t kIEExecutable[];
extern const wchar_t kSystemInstall[];
extern const wchar_t kUserInstall[];
+extern const wchar_t kWinFolder[];
// Window names.
extern const wchar_t kBrowserAppName[];
diff --git a/chrome/test/mini_installer_test/mini_installer_test_util.cc b/chrome/test/mini_installer_test/mini_installer_test_util.cc
index 8a5c08c..e8fb79d 100644
--- a/chrome/test/mini_installer_test/mini_installer_test_util.cc
+++ b/chrome/test/mini_installer_test/mini_installer_test_util.cc
@@ -111,10 +111,7 @@ bool MiniInstallerTestUtil::GetInstaller(const wchar_t* pattern,
while (builds_list_size != builds_list.rend()) {
path->assign(mini_installer_constants::kChromeDiffInstallerLocation);
file_util::AppendToPath(path, builds_list_size->name_);
- if (chrome_frame)
- file_util::AppendToPath(path, L"win_cf");
- else
- file_util::AppendToPath(path, L"win");
+ file_util::AppendToPath(path, mini_installer_constants::kWinFolder);
std::wstring installer_path(path->c_str());
file_util::AppendToPath(&installer_path, L"*.exe");
if (!GetLatestFile(installer_path.c_str(), pattern, &exe_list)) {
@@ -215,10 +212,9 @@ bool MiniInstallerTestUtil::GetPreviousFullInstaller(
// Create the full installer path.
FilePath installer = FilePath(
mini_installer_constants::kChromeDiffInstallerLocation);
- if (chrome_frame)
- installer = installer.Append(build_no).Append(L"win_cf").Append(name);
- else
- installer = installer.Append(build_no).Append(L"win").Append(name);
+ installer =
+ installer.Append(build_no)
+ .Append(mini_installer_constants::kWinFolder).Append(name);
previous->assign(installer.value());
return file_util::PathExists(installer);
diff --git a/chrome/test/mini_installer_test/test.cc b/chrome/test/mini_installer_test/test.cc
index 8903517..251c9cd 100644
--- a/chrome/test/mini_installer_test/test.cc
+++ b/chrome/test/mini_installer_test/test.cc
@@ -113,8 +113,7 @@ TEST_F(MiniInstallTest, FullOverPreviousFullUser) {
user_inst_->OverInstallOnFullInstaller(kFullInstall);
}
TEST_F(MiniInstallTest, FullOverPreviousFullSys) {
- if (!chrome_frame_)
- sys_inst_->OverInstallOnFullInstaller(kFullInstall);
+ sys_inst_->OverInstallOnFullInstaller(kFullInstall);
}
// Overinstall diff installer.
@@ -124,8 +123,7 @@ TEST_F(MiniInstallTest, DiffOverPreviousFullUser) {
}
TEST_F(MiniInstallTest, DiffOverPreviousFullSys) {
- if (!chrome_frame_)
- sys_inst_->OverInstallOnFullInstaller(kDiffInstall);
+ sys_inst_->OverInstallOnFullInstaller(kDiffInstall);
}
// Repair version folder.
@@ -135,8 +133,7 @@ TEST_F(MiniInstallTest, RepairFolderOnFullUser) {
}
TEST_F(MiniInstallTest, RepairFolderOnFullSys) {
- if (!chrome_frame_)
- sys_inst_->Repair(ChromeMiniInstaller::VERSION_FOLDER);
+ sys_inst_->Repair(ChromeMiniInstaller::VERSION_FOLDER);
}
// Repair registry.
@@ -145,8 +142,7 @@ TEST_F(MiniInstallTest, RepairRegistryOnFullUser) {
user_inst_->Repair(ChromeMiniInstaller::REGISTRY);
}
TEST_F(MiniInstallTest, RepairRegistryOnFullSys) {
- if (!chrome_frame_)
- sys_inst_->Repair(ChromeMiniInstaller::REGISTRY);
+ sys_inst_->Repair(ChromeMiniInstaller::REGISTRY);
}
// Install standalone.