OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 FilePath new_dir; | 1684 FilePath new_dir; |
1685 ASSERT_TRUE(CreateTemporaryDirInDir( | 1685 ASSERT_TRUE(CreateTemporaryDirInDir( |
1686 temp_dir_.path(), | 1686 temp_dir_.path(), |
1687 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), | 1687 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), |
1688 &new_dir)); | 1688 &new_dir)); |
1689 EXPECT_TRUE(PathExists(new_dir)); | 1689 EXPECT_TRUE(PathExists(new_dir)); |
1690 EXPECT_TRUE(temp_dir_.path().IsParent(new_dir)); | 1690 EXPECT_TRUE(temp_dir_.path().IsParent(new_dir)); |
1691 EXPECT_TRUE(DeleteFile(new_dir, false)); | 1691 EXPECT_TRUE(DeleteFile(new_dir, false)); |
1692 } | 1692 } |
1693 | 1693 |
| 1694 #if defined(OS_POSIX) |
1694 TEST_F(FileUtilTest, GetShmemTempDirTest) { | 1695 TEST_F(FileUtilTest, GetShmemTempDirTest) { |
1695 FilePath dir; | 1696 FilePath dir; |
1696 EXPECT_TRUE(GetShmemTempDir(false, &dir)); | 1697 EXPECT_TRUE(GetShmemTempDir(false, &dir)); |
1697 EXPECT_TRUE(DirectoryExists(dir)); | 1698 EXPECT_TRUE(DirectoryExists(dir)); |
1698 } | 1699 } |
| 1700 #endif |
1699 | 1701 |
1700 TEST_F(FileUtilTest, GetHomeDirTest) { | 1702 TEST_F(FileUtilTest, GetHomeDirTest) { |
1701 #if !defined(OS_ANDROID) // Not implemented on Android. | 1703 #if !defined(OS_ANDROID) // Not implemented on Android. |
1702 // We don't actually know what the home directory is supposed to be without | 1704 // We don't actually know what the home directory is supposed to be without |
1703 // calling some OS functions which would just duplicate the implementation. | 1705 // calling some OS functions which would just duplicate the implementation. |
1704 // So here we just test that it returns something "reasonable". | 1706 // So here we just test that it returns something "reasonable". |
1705 FilePath home = GetHomeDir(); | 1707 FilePath home = GetHomeDir(); |
1706 ASSERT_FALSE(home.empty()); | 1708 ASSERT_FALSE(home.empty()); |
1707 ASSERT_TRUE(home.IsAbsolute()); | 1709 ASSERT_TRUE(home.IsAbsolute()); |
1708 #endif | 1710 #endif |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 // Trying to close it should crash. This is important for security. | 2506 // Trying to close it should crash. This is important for security. |
2505 EXPECT_DEATH(CloseWithScopedFD(fds[1]), ""); | 2507 EXPECT_DEATH(CloseWithScopedFD(fds[1]), ""); |
2506 #endif | 2508 #endif |
2507 } | 2509 } |
2508 | 2510 |
2509 #endif // defined(OS_POSIX) | 2511 #endif // defined(OS_POSIX) |
2510 | 2512 |
2511 } // namespace | 2513 } // namespace |
2512 | 2514 |
2513 } // namespace base | 2515 } // namespace base |
OLD | NEW |