diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 05:09:50 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 05:09:50 +0000 |
commit | 66ff7356a381d6c8c6c3272b095938408c4f3188 (patch) | |
tree | 9c3ae2fb0d55d1d9650a8071d1c80c557e7f0d93 /chrome/test/mini_installer_test | |
parent | 2c8088a4452c2c204237ba9f2f3706e7eeaaf35b (diff) | |
download | chromium_src-66ff7356a381d6c8c6c3272b095938408c4f3188.zip chromium_src-66ff7356a381d6c8c6c3272b095938408c4f3188.tar.gz chromium_src-66ff7356a381d6c8c6c3272b095938408c4f3188.tar.bz2 |
Re-try r29078: Remove some deprecated file_util wstring functions.
With the previous patch, the try bots failed with mysterious messages, so I ignored them, patched it into my windows box and tested it there manually, and found no problems. As it turns out, the try failures were real :(. But nsylvain and I found the problem: the behavior of file_util::GetDirectoryFromPath() differs from DirName() when the path is empty (officially, GetDirectoryFromPath is not supposed to support non-absolute paths, but that is not enforced).
Here is a green win try result: http://build.chromium.org/buildbot/try-server/builders/win/builds/3705
mac: http://build.chromium.org/buildbot/try-server/builders/mac/builds/3491
linux: http://build.chromium.org/buildbot/try-server/builders/linux/builds/3466
I also applied this patch locally in Windows to test that it doesn't break the chrome frame compile or tests, since that's not covered by the trybots yet.
Review URL: http://codereview.chromium.org/271099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test')
3 files changed, 22 insertions, 23 deletions
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 79eb1d7..6c16075 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(path)); + ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(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(uninstall_path)); + ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(uninstall_path))); std::wstring uninstall_args = L"\"" + uninstall_path + L"\"" + L" --uninstall --force-uninstall"; if (install_type_ == mini_installer_constants::kSystemInstall) @@ -402,15 +402,16 @@ void ChromeMiniInstaller::FindChromeShortcut() { path = GetStartMenuShortcutPath(); file_util::AppendToPath(&path, mini_installer_constants::kChromeBuildType); // Verify if path exists. - if (file_util::PathExists(path)) { + if (file_util::PathExists(FilePath::FromWStringHack(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(path)); - ASSERT_TRUE(file_util::PathExists(uninstall_lnk)); + ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(path))); + ASSERT_TRUE(file_util::PathExists( + FilePath::FromWStringHack(uninstall_lnk))); } if (return_val) printf("Chrome shortcuts found are:\n%ls\n%ls\n\n", @@ -451,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(path)) { + if (!file_util::PathExists(FilePath::FromWStringHack(path))) { printf("This uninstall path is not correct %ls. Will not proceed further", path.c_str()); return L""; @@ -484,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(path)); + ASSERT_TRUE(file_util::PathExists(FilePath::FromWStringHack(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); @@ -503,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(path)); + return(file_util::PathExists(FilePath::FromWStringHack(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 9c511d1..3593f10 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(*path)) { + if (!file_util::PathExists(FilePath::FromWStringHack(*path))) { ++builds_list_size; } else { break; } } } - return (file_util::PathExists(path->c_str())); + return file_util::PathExists(FilePath::FromWStringHack(*path)); } // 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(previous->c_str())); + return file_util::PathExists(FilePath::FromWStringHack(*previous)); } 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 767ead2..9f2dc9f 100644 --- a/chrome/test/mini_installer_test/run_all_unittests.cc +++ b/chrome/test/mini_installer_test/run_all_unittests.cc @@ -15,22 +15,20 @@ void BackUpProfile() { exit(1); } ChromeMiniInstaller installer(mini_installer_constants::kUserInstall); - std::wstring path = installer.GetChromeInstallDirectoryLocation(); - file_util::AppendToPath(&path, mini_installer_constants::kChromeAppDir); - file_util::UpOneDirectory(&path); - std::wstring backup_path = path; + FilePath path = + FilePath::FromWStringHack(installer.GetChromeInstallDirectoryLocation()); + path = path.Append(mini_installer_constants::kChromeAppDir).DirName(); + FilePath backup_path = path; // Will hold User Data path that needs to be backed-up. - file_util::AppendToPath(&path, - mini_installer_constants::kChromeUserDataDir); + path = path.Append(mini_installer_constants::kChromeUserDataDir); // Will hold new backup path to save the profile. - file_util::AppendToPath(&backup_path, - mini_installer_constants::kChromeUserDataBackupDir); + backup_path = path.Append(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.c_str(), true); + file_util::Delete(backup_path, true); file_util::CopyDirectory(path, backup_path, true); } else { printf("Chrome is not installed. Will not take any backup\n"); |