| 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 #ifndef BASE_TEST_FILE_UTIL_H_ | 5 #ifndef BASE_TEST_TEST_FILE_UTIL_H_ |
| 6 #define BASE_TEST_FILE_UTIL_H_ | 6 #define BASE_TEST_TEST_FILE_UTIL_H_ |
| 7 | 7 |
| 8 // File utility functions used only by tests. | 8 // File utility functions used only by tests. |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 class FilePath; | 12 class FilePath; |
| 13 | 13 |
| 14 namespace file_util { | 14 namespace file_util { |
| 15 | 15 |
| 16 // Wrapper over file_util::Delete. On Windows repeatedly invokes Delete in case | 16 // Wrapper over file_util::Delete. On Windows repeatedly invokes Delete in case |
| 17 // of failure to workaround Windows file locking semantics. Returns true on | 17 // of failure to workaround Windows file locking semantics. Returns true on |
| 18 // success. | 18 // success. |
| 19 bool DieFileDie(const FilePath& file, bool recurse); | 19 bool DieFileDie(const FilePath& file, bool recurse); |
| 20 | 20 |
| 21 // Clear a specific file from the system cache. After this call, trying | 21 // Clear a specific file from the system cache. After this call, trying |
| 22 // to access this file will result in a cold load from the hard drive. | 22 // to access this file will result in a cold load from the hard drive. |
| 23 bool EvictFileFromSystemCache(const FilePath& file); | 23 bool EvictFileFromSystemCache(const FilePath& file); |
| 24 | 24 |
| 25 // Like CopyFileNoCache but recursively copies all files and subdirectories | 25 // Like CopyFileNoCache but recursively copies all files and subdirectories |
| 26 // in the given input directory to the output directory. Any files in the | 26 // in the given input directory to the output directory. Any files in the |
| 27 // destination that already exist will be overwritten. | 27 // destination that already exist will be overwritten. |
| 28 // | 28 // |
| 29 // Returns true on success. False means there was some error copying, so the | 29 // Returns true on success. False means there was some error copying, so the |
| 30 // state of the destination is unknown. | 30 // state of the destination is unknown. |
| 31 bool CopyRecursiveDirNoCache(const FilePath& source_dir, | 31 bool CopyRecursiveDirNoCache(const FilePath& source_dir, |
| 32 const FilePath& dest_dir); | 32 const FilePath& dest_dir); |
| 33 | 33 |
| 34 } // namespace file_util | 34 } // namespace file_util |
| 35 | 35 |
| 36 #endif // BASE_TEST_FILE_UTIL_H_ | 36 #endif // BASE_TEST_TEST_FILE_UTIL_H_ |
| OLD | NEW |