summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 01:24:55 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 01:24:55 +0000
commit9bd7d83647cf5add52fd0beafbe5f51a03b3585e (patch)
treeefd61d0f01c830ffa73a3f83e82d5c77132d9a75 /chrome/browser/printing
parent9d72e8a3a4beb44db73b7bbe6b76e0eaef623fec (diff)
downloadchromium_src-9bd7d83647cf5add52fd0beafbe5f51a03b3585e.zip
chromium_src-9bd7d83647cf5add52fd0beafbe5f51a03b3585e.tar.gz
chromium_src-9bd7d83647cf5add52fd0beafbe5f51a03b3585e.tar.bz2
Uses the FilePath::CopyFile version that recieves FilePath instead of std::wstring.
BUG=None TEST=None Patch by Thiago Farina <thiago.farina@gmail.com> at http://codereview.chromium.org/164383 Review URL: http://codereview.chromium.org/174168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/printing_layout_uitest.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index d68a78d..f135566 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -60,8 +60,8 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
// data pixels and returns the percentage of different pixels; 0 for success,
// ]0, 100] for failure.
double CompareWithResult(const std::wstring& verification_name) {
- std::wstring test_result(ScanFiles(verification_name));
- if (test_result.empty()) {
+ FilePath test_result(ScanFiles(verification_name));
+ if (test_result.value().empty()) {
// 100% different, the print job buffer is not there.
return 100.;
}
@@ -69,27 +69,27 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
std::wstring verification_file(test_data_directory_.ToWStringHack());
file_util::AppendToPath(&verification_file, L"printing");
file_util::AppendToPath(&verification_file, verification_name);
- std::wstring emf(verification_file + L".emf");
- std::wstring png(verification_file + L".png");
+ FilePath emf(verification_file + L".emf");
+ FilePath png(verification_file + L".png");
// Looks for Cleartype override.
if (file_util::PathExists(verification_file + L"_cleartype.png") &&
IsClearTypeEnabled()) {
- png = verification_file + L"_cleartype.png";
+ png = FilePath(verification_file + L"_cleartype.png");
}
if (GenerateFiles()) {
// Copy the .emf and generate an .png.
file_util::CopyFile(test_result, emf);
- Image emf_content(emf);
- emf_content.SaveToPng(png);
+ Image emf_content(emf.value());
+ emf_content.SaveToPng(png.value());
// Saving is always fine.
return 0;
} else {
// File compare between test and result.
- Image emf_content(emf);
- Image test_content(test_result);
- Image png_content(png);
+ Image emf_content(emf.value());
+ Image test_content(test_result.value());
+ Image png_content(png.value());
double diff_emf = emf_content.PercentageDifferent(test_content);
EXPECT_EQ(0., diff_emf) << verification_name <<
@@ -97,7 +97,8 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
L" result size:" << test_content.size();
if (diff_emf) {
// Backup the result emf file.
- file_util::CopyFile(test_result, verification_file + L"_failed.emf");
+ file_util::CopyFile(test_result, FilePath(
+ verification_file + L"_failed.emf"));
}
// This verification is only to know that the EMF rendering stays