diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 03:41:02 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 03:41:02 +0000 |
commit | 6ec54c1e86aa5d29c7223a86acbfa850be39c806 (patch) | |
tree | 8c0be0238c2f35646c3545060375a9032c50b04d /chrome/test/mini_installer_test | |
parent | 89f580b14355e7342cff030747d12ec18f8ca012 (diff) | |
download | chromium_src-6ec54c1e86aa5d29c7223a86acbfa850be39c806.zip chromium_src-6ec54c1e86aa5d29c7223a86acbfa850be39c806.tar.gz chromium_src-6ec54c1e86aa5d29c7223a86acbfa850be39c806.tar.bz2 |
Revert wstring patch (r29078 and follow up commits). It is causing failures on the buildbots.
TBR=nsylvain
Review URL: http://codereview.chromium.org/280004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test')
3 files changed, 23 insertions, 22 deletions
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 3c50b46..75fab2d8 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -112,7 +112,7 @@ void ChromeMiniInstaller::InstallMiniInstaller(bool over_install, printf("\nChrome will be installed at %ls level\n", install_type_.c_str()); printf("\nWill proceed with the test only if this path exists: %ls\n\n", path.c_str()); - ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(path))); + ASSERT_TRUE(file_util::PathExists(path)); LaunchInstaller(path, exe_name.c_str()); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); ASSERT_TRUE(CheckRegistryKey(dist->GetVersionKey())); @@ -230,7 +230,7 @@ void ChromeMiniInstaller::UnInstall() { CleanChromeInstall(); return; } - ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(uninstall_path))); + ASSERT_TRUE(file_util::PathExists(uninstall_path)); std::wstring uninstall_args = L"\"" + uninstall_path + L"\"" + L" --uninstall --force-uninstall"; if (install_type_ == mini_installer_constants::kSystemInstall) @@ -403,16 +403,15 @@ void ChromeMiniInstaller::FindChromeShortcut() { path = GetStartMenuShortcutPath(); file_util::AppendToPath(&path, mini_installer_constants::kChromeBuildType); // Verify if path exists. - if (file_util::PathExists(FilePath::FromWStringHack(path))) { + if (file_util::PathExists(path)) { return_val = true; uninstall_lnk = path; file_util::AppendToPath(&path, mini_installer_constants::kChromeLaunchShortcut); file_util::AppendToPath(&uninstall_lnk, mini_installer_constants::kChromeUninstallShortcut); - ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(path))); - ASSERT_TRUE(file_util::PathExists( - FilePath::FromWStringHack(uninstall_lnk))); + ASSERT_TRUE(file_util::PathExists(path)); + ASSERT_TRUE(file_util::PathExists(uninstall_lnk)); } if (return_val) printf("Chrome shortcuts found are:\n%ls\n%ls\n\n", @@ -453,7 +452,7 @@ std::wstring ChromeMiniInstaller::GetUninstallPath() { file_util::AppendToPath(&path, installer_util::kInstallerDir); file_util::AppendToPath(&path, mini_installer_constants::kChromeSetupExecutable); - if (!file_util::PathExists(FilePath::FromWStringHack(path))) { + if (!file_util::PathExists(path)) { printf("This uninstall path is not correct %ls. Will not proceed further", path.c_str()); return L""; @@ -486,7 +485,7 @@ HKEY ChromeMiniInstaller::GetRootRegistryKey() { // Launches the chrome installer and waits for it to end. void ChromeMiniInstaller::LaunchInstaller(const std::wstring& path, const wchar_t* process_name) { - ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(path))); + ASSERT_TRUE(file_util::PathExists(path)); if (install_type_ == mini_installer_constants::kSystemInstall) { std::wstring launch_args = L" -system-level"; base::LaunchApp(L"\"" + path + L"\"" + launch_args, false, false, NULL); @@ -505,7 +504,7 @@ bool ChromeMiniInstaller::GetChromeLaunchPath(std::wstring* launch_path) { file_util::AppendToPath(&path, mini_installer_constants::kChromeAppDir); file_util::AppendToPath(&path, installer_util::kChromeExe); launch_path->assign(path); - return(file_util::PathExists(FilePath::FromWStringHack(path))); + return(file_util::PathExists(path)); } // Launch Chrome to see if it works after overinstall. Then close it. 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 3593f10..9c511d1 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_util.cc +++ b/chrome/test/mini_installer_test/mini_installer_test_util.cc @@ -117,14 +117,14 @@ bool MiniInstallerTestUtil::GetInstaller(const wchar_t* pattern, ++builds_list_size; } else { file_util::AppendToPath(path, exe_list.at(0).name_.c_str()); - if (!file_util::PathExists(FilePath::FromWStringHack(*path))) { + if (!file_util::PathExists(*path)) { ++builds_list_size; } else { break; } } } - return file_util::PathExists(FilePath::FromWStringHack(*path)); + return (file_util::PathExists(path->c_str())); } // This method will get the latest installer filename from the directory. @@ -202,7 +202,7 @@ bool MiniInstallerTestUtil::GetPreviousFullInstaller( &directory_list)) return false; file_util::AppendToPath(previous, directory_list.at(0).name_); - return file_util::PathExists(FilePath::FromWStringHack(*previous)); + return (file_util::PathExists(previous->c_str())); } bool MiniInstallerTestUtil::GetStandaloneInstallerFileName( @@ -210,9 +210,9 @@ bool MiniInstallerTestUtil::GetStandaloneInstallerFileName( std::wstring standalone_installer( mini_installer_constants::kChromeStandAloneInstallerLocation); standalone_installer.append(L"*.exe"); - return GetLatestFile(standalone_installer.c_str(), - mini_installer_constants::kUntaggedInstallerPattern, - file_name); + return (GetLatestFile(standalone_installer.c_str(), + mini_installer_constants::kUntaggedInstallerPattern, + file_name)); } bool MiniInstallerTestUtil::GetStandaloneVersion( diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc index 9f2dc9f..767ead2 100644 --- a/chrome/test/mini_installer_test/run_all_unittests.cc +++ b/chrome/test/mini_installer_test/run_all_unittests.cc @@ -15,20 +15,22 @@ void BackUpProfile() { exit(1); } ChromeMiniInstaller installer(mini_installer_constants::kUserInstall); - FilePath path = - FilePath::FromWStringHack(installer.GetChromeInstallDirectoryLocation()); - path = path.Append(mini_installer_constants::kChromeAppDir).DirName(); - FilePath backup_path = path; + std::wstring path = installer.GetChromeInstallDirectoryLocation(); + file_util::AppendToPath(&path, mini_installer_constants::kChromeAppDir); + file_util::UpOneDirectory(&path); + std::wstring backup_path = path; // Will hold User Data path that needs to be backed-up. - path = path.Append(mini_installer_constants::kChromeUserDataDir); + file_util::AppendToPath(&path, + mini_installer_constants::kChromeUserDataDir); // Will hold new backup path to save the profile. - backup_path = path.Append(mini_installer_constants::kChromeUserDataBackupDir); + file_util::AppendToPath(&backup_path, + mini_installer_constants::kChromeUserDataBackupDir); // Will check if User Data profile is available. if (file_util::PathExists(path)) { // Will check if User Data is already backed up. // If yes, will delete and create new one. if (file_util::PathExists(backup_path)) - file_util::Delete(backup_path, true); + file_util::Delete(backup_path.c_str(), true); file_util::CopyDirectory(path, backup_path, true); } else { printf("Chrome is not installed. Will not take any backup\n"); |