OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <winioctl.h> | 9 #include <winioctl.h> |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 &temp_dir)); | 1570 &temp_dir)); |
1571 EXPECT_TRUE(file_util::PathExists(temp_dir)); | 1571 EXPECT_TRUE(file_util::PathExists(temp_dir)); |
1572 EXPECT_TRUE(file_util::Delete(temp_dir, false)); | 1572 EXPECT_TRUE(file_util::Delete(temp_dir, false)); |
1573 } | 1573 } |
1574 | 1574 |
1575 TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) { | 1575 TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) { |
1576 FilePath new_dir; | 1576 FilePath new_dir; |
1577 ASSERT_TRUE(file_util::CreateTemporaryDirInDir( | 1577 ASSERT_TRUE(file_util::CreateTemporaryDirInDir( |
1578 test_dir_, | 1578 test_dir_, |
1579 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), | 1579 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), |
1580 false, | |
1581 &new_dir)); | 1580 &new_dir)); |
1582 EXPECT_TRUE(file_util::PathExists(new_dir)); | 1581 EXPECT_TRUE(file_util::PathExists(new_dir)); |
1583 EXPECT_TRUE(test_dir_.IsParent(new_dir)); | 1582 EXPECT_TRUE(test_dir_.IsParent(new_dir)); |
1584 EXPECT_TRUE(file_util::Delete(new_dir, false)); | 1583 EXPECT_TRUE(file_util::Delete(new_dir, false)); |
1585 } | 1584 } |
1586 | 1585 |
1587 TEST_F(FileUtilTest, GetShmemTempDirTest) { | 1586 TEST_F(FileUtilTest, GetShmemTempDirTest) { |
1588 FilePath dir; | 1587 FilePath dir; |
1589 EXPECT_TRUE(file_util::GetShmemTempDir(&dir)); | 1588 EXPECT_TRUE(file_util::GetShmemTempDir(&dir)); |
1590 EXPECT_TRUE(file_util::DirectoryExists(dir)); | 1589 EXPECT_TRUE(file_util::DirectoryExists(dir)); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); | 1856 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); |
1858 | 1857 |
1859 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); | 1858 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); |
1860 std::string bar("baz"); | 1859 std::string bar("baz"); |
1861 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); | 1860 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); |
1862 | 1861 |
1863 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); | 1862 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); |
1864 } | 1863 } |
1865 | 1864 |
1866 } // namespace | 1865 } // namespace |
OLD | NEW |