summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 09:18:34 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-13 09:18:34 +0000
commit6c8152e083e52454063fd717ecc0bb193b0c808d (patch)
tree17cdfdd9a455c4f6c2b0c39cf4e24616fcc106b9 /chrome
parentf91a6f86d1847f2335dabf4d1757c5af662c7851 (diff)
downloadchromium_src-6c8152e083e52454063fd717ecc0bb193b0c808d.zip
chromium_src-6c8152e083e52454063fd717ecc0bb193b0c808d.tar.gz
chromium_src-6c8152e083e52454063fd717ecc0bb193b0c808d.tar.bz2
Cleanup: Remove deprecated version of file_util::AppendToPath().
BUG=24672 TEST=none Review URL: http://codereview.chromium.org/9585001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/printing/printing_layout_uitest.cc24
-rw-r--r--chrome/test/mini_installer_test/installer_test_util.cc25
2 files changed, 21 insertions, 28 deletions
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index 29c7d15..97584f1 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -60,18 +60,14 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
return 100.;
}
- std::wstring verification_file(test_data_directory_.value());
- file_util::AppendToPath(&verification_file, L"printing");
- file_util::AppendToPath(&verification_file, verification_name);
- FilePath emf(verification_file + L".emf");
- FilePath png(verification_file + L".png");
+ FilePath base_path(test_data_directory_.AppendASCII("printing"));
+ FilePath emf(base_path.Append(verification_name + L".emf"));
+ FilePath png(base_path.Append(verification_name + L".png"));
+ FilePath cleartype(base_path.Append(verification_name + L"_cleartype.png"));
// Looks for Cleartype override.
- if (file_util::PathExists(
- FilePath::FromWStringHack(verification_file + L"_cleartype.png")) &&
- IsClearTypeEnabled()) {
- png = FilePath(verification_file + L"_cleartype.png");
- }
+ if (file_util::PathExists(cleartype) && IsClearTypeEnabled())
+ png = cleartype;
if (GenerateFiles()) {
// Copy the .emf and generate an .png.
@@ -92,8 +88,8 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
" result size:" << test_content.size().ToString();
if (diff_emf) {
// Backup the result emf file.
- file_util::CopyFile(test_result, FilePath(
- verification_file + L"_failed.emf"));
+ FilePath failed(base_path.Append(verification_name + L"_failed.emf"));
+ file_util::CopyFile(test_result, failed);
}
// This verification is only to know that the EMF rendering stays
@@ -104,7 +100,9 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
" result size:" << test_content.size().ToString();
if (diff_png) {
// Backup the rendered emf file to detect the rendering difference.
- emf_content.SaveToPng(FilePath(verification_file + L"_rendering.png"));
+ FilePath rendering(
+ base_path.Append(verification_name + L"_rendering.png"));
+ emf_content.SaveToPng(rendering);
}
return std::max(diff_png, diff_emf);
}
diff --git a/chrome/test/mini_installer_test/installer_test_util.cc b/chrome/test/mini_installer_test/installer_test_util.cc
index 4e2a7ea..ad93c54 100644
--- a/chrome/test/mini_installer_test/installer_test_util.cc
+++ b/chrome/test/mini_installer_test/installer_test_util.cc
@@ -56,28 +56,24 @@ bool DeleteInstallDirectory(bool system_level,
if (version.empty())
return false;
FilePath path;
- if (!GetInstallDirectory(system_level,
- ToBrowserDistributionType(type), &path) ||
- !file_util::PathExists(path))
+ bool has_install_dir = GetInstallDirectory(system_level,
+ ToBrowserDistributionType(type),
+ &path);
+ if (!has_install_dir || !file_util::PathExists(path))
return false;
path = path.AppendASCII(version);
- if (!file_util::Delete(path, true))
- return false;
- return true;
+ return file_util::Delete(path, true);
}
bool DeleteRegistryKey(bool system_level,
InstallationValidator::InstallationType type) {
- FilePath::StringType key(google_update::kRegPathClients);
BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution(
ToBrowserDistributionType(type));
- file_util::AppendToPath(&key, dist->GetAppGuid());
- HKEY root = HKEY_CURRENT_USER;
- if (system_level)
- root = HKEY_LOCAL_MACHINE;
- if (InstallUtil::DeleteRegistryKey(root, key))
- return true;
- return false;
+ FilePath::StringType key(google_update::kRegPathClients);
+ key.push_back(FilePath::kSeparators[0]);
+ key.append(dist->GetAppGuid());
+ HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
+ return InstallUtil::DeleteRegistryKey(root, key);
}
bool GetChromeInstallDirectory(bool system_level, FilePath* path) {
@@ -303,4 +299,3 @@ bool RunAndWaitForCommandToFinish(CommandLine command) {
}
} // namespace
-