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

Unified Diff: base/file_path_unittest.cc

Issue 8402008: Add FilePath::FromUTF8Unsafe() and FilePath::AsUTF8Unsafe(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
Index: base/file_path_unittest.cc
diff --git a/base/file_path_unittest.cc b/base/file_path_unittest.cc
index 6eb106be68cde0bb81324c5dd6fee7aac16676c7..5f32621ebbad080b08153640bb8800e915b292f6 100644
--- a/base/file_path_unittest.cc
+++ b/base/file_path_unittest.cc
@@ -1044,6 +1044,16 @@ TEST_F(FilePathTest, ReferencesParent) {
}
}
+TEST_F(FilePathTest, FromUTF8) {
+ FilePath path = FilePath::FromUTF8("foo.txt");
+ EXPECT_EQ(FPL("foo.txt"), path.value());
+}
+
+TEST_F(FilePathTest, AsUTF8) {
+ FilePath path(FPL("foo.txt"));
+ EXPECT_EQ("foo.txt", path.AsUTF8());
jungshik at Google 2011/10/31 21:29:03 Would you consider adding some non-trivial cases h
+}
+
#if defined(FILE_PATH_USES_WIN_SEPARATORS)
TEST_F(FilePathTest, NormalizeWindowsPathSeparators) {
const struct UnaryTestData cases[] = {
@@ -1086,4 +1096,5 @@ TEST_F(FilePathTest, NormalizeWindowsPathSeparators) {
"i: " << i << ", input: " << input.value();
}
}
+
#endif
« base/file_path.h ('K') | « base/file_path.cc ('k') | base/value_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698