| 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 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 // create the directories | 1839 // create the directories |
| 1840 FilePath dir1 = temp_dir_.path().Append(FILE_PATH_LITERAL("dir1")); | 1840 FilePath dir1 = temp_dir_.path().Append(FILE_PATH_LITERAL("dir1")); |
| 1841 EXPECT_TRUE(file_util::CreateDirectory(dir1)); | 1841 EXPECT_TRUE(file_util::CreateDirectory(dir1)); |
| 1842 FilePath dir2 = temp_dir_.path().Append(FILE_PATH_LITERAL("dir2")); | 1842 FilePath dir2 = temp_dir_.path().Append(FILE_PATH_LITERAL("dir2")); |
| 1843 EXPECT_TRUE(file_util::CreateDirectory(dir2)); | 1843 EXPECT_TRUE(file_util::CreateDirectory(dir2)); |
| 1844 FilePath dir2inner = dir2.Append(FILE_PATH_LITERAL("inner")); | 1844 FilePath dir2inner = dir2.Append(FILE_PATH_LITERAL("inner")); |
| 1845 EXPECT_TRUE(file_util::CreateDirectory(dir2inner)); | 1845 EXPECT_TRUE(file_util::CreateDirectory(dir2inner)); |
| 1846 | 1846 |
| 1847 // create the files | 1847 // create the files |
| 1848 FilePath dir2file = dir2.Append(FILE_PATH_LITERAL("dir2file.txt")); | 1848 FilePath dir2file = dir2.Append(FILE_PATH_LITERAL("dir2file.txt")); |
| 1849 CreateTextFile(dir2file, L""); | 1849 CreateTextFile(dir2file, std::wstring()); |
| 1850 FilePath dir2innerfile = dir2inner.Append(FILE_PATH_LITERAL("innerfile.txt")); | 1850 FilePath dir2innerfile = dir2inner.Append(FILE_PATH_LITERAL("innerfile.txt")); |
| 1851 CreateTextFile(dir2innerfile, L""); | 1851 CreateTextFile(dir2innerfile, std::wstring()); |
| 1852 FilePath file1 = temp_dir_.path().Append(FILE_PATH_LITERAL("file1.txt")); | 1852 FilePath file1 = temp_dir_.path().Append(FILE_PATH_LITERAL("file1.txt")); |
| 1853 CreateTextFile(file1, L""); | 1853 CreateTextFile(file1, std::wstring()); |
| 1854 FilePath file2_rel = | 1854 FilePath file2_rel = dir2.Append(FilePath::kParentDirectory) |
| 1855 dir2.Append(FilePath::kParentDirectory) | 1855 .Append(FILE_PATH_LITERAL("file2.txt")); |
| 1856 .Append(FILE_PATH_LITERAL("file2.txt")); | 1856 CreateTextFile(file2_rel, std::wstring()); |
| 1857 CreateTextFile(file2_rel, L""); | |
| 1858 FilePath file2_abs = temp_dir_.path().Append(FILE_PATH_LITERAL("file2.txt")); | 1857 FilePath file2_abs = temp_dir_.path().Append(FILE_PATH_LITERAL("file2.txt")); |
| 1859 | 1858 |
| 1860 // Only enumerate files. | 1859 // Only enumerate files. |
| 1861 file_util::FileEnumerator f1(temp_dir_.path(), true, | 1860 file_util::FileEnumerator f1(temp_dir_.path(), true, |
| 1862 file_util::FileEnumerator::FILES); | 1861 file_util::FileEnumerator::FILES); |
| 1863 FindResultCollector c1(f1); | 1862 FindResultCollector c1(f1); |
| 1864 EXPECT_TRUE(c1.HasFile(file1)); | 1863 EXPECT_TRUE(c1.HasFile(file1)); |
| 1865 EXPECT_TRUE(c1.HasFile(file2_abs)); | 1864 EXPECT_TRUE(c1.HasFile(file2_abs)); |
| 1866 EXPECT_TRUE(c1.HasFile(dir2file)); | 1865 EXPECT_TRUE(c1.HasFile(dir2file)); |
| 1867 EXPECT_TRUE(c1.HasFile(dir2innerfile)); | 1866 EXPECT_TRUE(c1.HasFile(dir2innerfile)); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2423 file_util::VerifyPathControlledByUser( | 2422 file_util::VerifyPathControlledByUser( |
| 2424 base_dir_, text_file_, uid_, ok_gids_)); | 2423 base_dir_, text_file_, uid_, ok_gids_)); |
| 2425 EXPECT_TRUE( | 2424 EXPECT_TRUE( |
| 2426 file_util::VerifyPathControlledByUser( | 2425 file_util::VerifyPathControlledByUser( |
| 2427 sub_dir_, text_file_, uid_, ok_gids_)); | 2426 sub_dir_, text_file_, uid_, ok_gids_)); |
| 2428 } | 2427 } |
| 2429 | 2428 |
| 2430 #endif // defined(OS_POSIX) | 2429 #endif // defined(OS_POSIX) |
| 2431 | 2430 |
| 2432 } // namespace | 2431 } // namespace |
| OLD | NEW |