summaryrefslogtreecommitdiffstats
path: root/base/mac_util_unittest.mm
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:27:19 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:27:19 +0000
commit2438b1729d34840ed380ce1ef4f37f3f56faa5e7 (patch)
tree9f631c1af54409bc0fa13eb6e1743f0a0c3c9fe5 /base/mac_util_unittest.mm
parentc80f9b0e650db3addaa0217be50da5bebd323cc3 (diff)
downloadchromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.zip
chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.gz
chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.bz2
Moved GetUserDirectory() into mac_util.mm.
Made mac_util.mm and chrome_paths_mac.mm use GetUserDirectory(). Made firefox_importer_utils_mac.mm use PathService. Added unittests for GetUserDirectory(). BUG=22045 TEST=trybots Review URL: http://codereview.chromium.org/548123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac_util_unittest.mm')
-rw-r--r--base/mac_util_unittest.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/base/mac_util_unittest.mm b/base/mac_util_unittest.mm
index 676353b..801922a 100644
--- a/base/mac_util_unittest.mm
+++ b/base/mac_util_unittest.mm
@@ -29,6 +29,22 @@ TEST_F(MacUtilTest, TestFSRef) {
EXPECT_EQ(path, PathFromFSRef(ref));
}
+TEST_F(MacUtilTest, GetUserDirectoryTest) {
+ // Try a few keys, make sure they come back with non-empty paths.
+ FilePath caches_dir;
+ EXPECT_TRUE(GetUserDirectory(NSCachesDirectory, &caches_dir));
+ EXPECT_FALSE(caches_dir.empty());
+
+ FilePath application_support_dir;
+ EXPECT_TRUE(GetUserDirectory(NSApplicationSupportDirectory,
+ &application_support_dir));
+ EXPECT_FALSE(application_support_dir.empty());
+
+ FilePath library_dir;
+ EXPECT_TRUE(GetUserDirectory(NSLibraryDirectory, &library_dir));
+ EXPECT_FALSE(library_dir.empty());
+}
+
TEST_F(MacUtilTest, TestLibraryPath) {
FilePath library_dir = GetUserLibraryPath();
// Make sure the string isn't empty.