PrintTo for FilePath -- Pretty-print when comparing FilePaths in gtest

Used in upcoming http://codereview.chromium.org/10996005/ (and potentially others).

BUG=148539
TEST=Write a test with an error comparing two FilePaths and confirm the paths' values are printed by gtest as opposed to the byte-representation.


Review URL: https://chromiumcodereview.appspot.com/10984028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158893 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/file_path.cc b/base/file_path.cc
index 98cbfde..094c699 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -1232,3 +1232,7 @@
   return *this;
 #endif
 }
+
+void PrintTo(const FilePath& path, std::ostream* out) {
+  *out << path.value();
+}
diff --git a/base/file_path.h b/base/file_path.h
index 3770a8e..09e8269 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -396,6 +396,9 @@
   StringType path_;
 };
 
+// This is required by googletest to print a readable output on test failures.
+BASE_EXPORT extern void PrintTo(const FilePath& path, std::ostream* out);
+
 // Macros for string literal initialization of FilePath::CharType[], and for
 // using a FilePath::CharType[] in a printf-style format string.
 #if defined(OS_POSIX)
OSZAR »