OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/mac_util.h" | 5 #include "base/mac_util.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 | 8 |
| 9 #include "base/file_path.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
11 | 12 |
12 typedef PlatformTest MacUtilTest; | 13 typedef PlatformTest MacUtilTest; |
13 | 14 |
14 TEST_F(MacUtilTest, TestFSRef) { | 15 TEST_F(MacUtilTest, TestFSRef) { |
15 FSRef ref; | 16 FSRef ref; |
16 std::string path("/System/Library"); | 17 std::string path("/System/Library"); |
17 | 18 |
18 ASSERT_TRUE(mac_util::FSRefFromPath(path, &ref)); | 19 ASSERT_TRUE(mac_util::FSRefFromPath(path, &ref)); |
19 EXPECT_EQ(path, mac_util::PathFromFSRef(ref)); | 20 EXPECT_EQ(path, mac_util::PathFromFSRef(ref)); |
20 } | 21 } |
| 22 |
| 23 TEST_F(MacUtilTest, TestLibraryPath) { |
| 24 FilePath library_dir = mac_util::GetUserLibraryPath(); |
| 25 // Make sure the string isn't empty. |
| 26 EXPECT_FALSE(library_dir.value().empty()); |
| 27 } |
OLD | NEW |