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

Unified Diff: base/file_util_unittest.cc

Issue 159833003: Add support for GetHomeDir for Mac and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 6 years, 10 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_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index df447ab9b4e3927b9a80c8d3d0e52278d390b218..69414b4e9f9cd807b2ceec806a92c0353d7c9f81 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1691,6 +1691,17 @@ TEST_F(FileUtilTest, GetShmemTempDirTest) {
EXPECT_TRUE(DirectoryExists(dir));
}
+TEST_F(FileUtilTest, GetHomeDirTest) {
+#if !defined(OS_ANDROID) // Not implemented on Android.
+ // We don't actually know what the home directory is supposed to be without
+ // calling some OS functions which would just duplicate the implementation.
+ // So here we just test that it returns something "reasonable".
+ FilePath home = GetHomeDir();
+ ASSERT_FALSE(home.empty());
+ ASSERT_TRUE(home.IsAbsolute());
+#endif
+}
+
TEST_F(FileUtilTest, CreateDirectoryTest) {
FilePath test_root =
temp_dir_.path().Append(FILE_PATH_LITERAL("create_directory_test"));

Powered by Google App Engine
This is Rietveld 408576698