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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 | 689 |
690 // Make sure it's deleted | 690 // Make sure it's deleted |
691 EXPECT_TRUE(file_util::Delete(file_name, true)); | 691 EXPECT_TRUE(file_util::Delete(file_name, true)); |
692 EXPECT_FALSE(file_util::PathExists(file_name)); | 692 EXPECT_FALSE(file_util::PathExists(file_name)); |
693 } | 693 } |
694 | 694 |
695 #if defined(OS_WIN) | 695 #if defined(OS_WIN) |
696 // Tests that the Delete function works for wild cards, especially | 696 // Tests that the Delete function works for wild cards, especially |
697 // with the recursion flag. Also coincidentally tests PathExists. | 697 // with the recursion flag. Also coincidentally tests PathExists. |
698 // TODO(erikkay): see if anyone's actually using this feature of the API | 698 // TODO(erikkay): see if anyone's actually using this feature of the API |
699 TEST_F(FileUtilTest, DeleteWildCard) { | 699 TEST_F(FileUtilTest, DISABLED_DeleteWildCard) { |
kinuko
2010/12/10 23:03:43
Maybe we should delete this test (and cc erikkay a
Kavita Kanetkar
2010/12/14 21:36:37
Done.
| |
700 // Create a file and a directory | 700 // Create a file and a directory |
701 FilePath file_name = temp_dir_.path().Append(FPL("Test DeleteWildCard.txt")); | 701 FilePath file_name = temp_dir_.path().Append(FPL("Test DeleteWildCard.txt")); |
702 CreateTextFile(file_name, bogus_content); | 702 CreateTextFile(file_name, bogus_content); |
703 ASSERT_TRUE(file_util::PathExists(file_name)); | 703 ASSERT_TRUE(file_util::PathExists(file_name)); |
704 | 704 |
705 FilePath subdir_path = temp_dir_.path().Append(FPL("DeleteWildCardDir")); | 705 FilePath subdir_path = temp_dir_.path().Append(FPL("DeleteWildCardDir")); |
706 file_util::CreateDirectory(subdir_path); | 706 file_util::CreateDirectory(subdir_path); |
707 ASSERT_TRUE(file_util::PathExists(subdir_path)); | 707 ASSERT_TRUE(file_util::PathExists(subdir_path)); |
708 | 708 |
709 // Create the wildcard path | 709 // Create the wildcard path |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1827 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); | 1827 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); |
1828 | 1828 |
1829 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); | 1829 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); |
1830 std::string bar("baz"); | 1830 std::string bar("baz"); |
1831 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); | 1831 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); |
1832 | 1832 |
1833 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); | 1833 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); |
1834 } | 1834 } |
1835 | 1835 |
1836 } // namespace | 1836 } // namespace |
OLD | NEW |