Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3154)

Unified Diff: chrome/test/gpu/gpu_pixel_browsertest.cc

Issue 11820034: Fix ReadFileToSTring failure due to '..' in the path. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/gpu/gpu_pixel_browsertest.cc
===================================================================
--- chrome/test/gpu/gpu_pixel_browsertest.cc (revision 175605)
+++ chrome/test/gpu/gpu_pixel_browsertest.cc (working copy)
@@ -62,8 +62,12 @@
// should have been encoded using |gfx::PNGCodec::Encode|.
bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) {
DCHECK(bitmap);
+ FilePath abs_path(file_path);
+ if (!file_util::AbsolutePath(&abs_path))
+ return false;
+
std::string png_data;
- return file_util::ReadFileToString(file_path, &png_data) &&
+ return file_util::ReadFileToString(abs_path, &png_data) &&
gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&png_data[0]),
png_data.length(),
bitmap);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698