Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: base/test/test_file_util_win.cc

Issue 13646016: Delete CopyRecursiveDirNoCache from test_file_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_file_util_posix.cc ('k') | chrome/test/automation/proxy_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_file_util_win.cc
diff --git a/base/test/test_file_util_win.cc b/base/test/test_file_util_win.cc
index 8d28aef76839c385ff1858054b6ba4adcd2b42cf..8e130d842107201f6f4e7f2bd239d0ae1013d83b 100644
--- a/base/test/test_file_util_win.cc
+++ b/base/test/test_file_util_win.cc
@@ -216,59 +216,6 @@ bool EvictFileFromSystemCache(const base::FilePath& file) {
return true;
}
-// Like CopyFileNoCache but recursively copies all files and subdirectories
-// in the given input directory to the output directory.
-bool CopyRecursiveDirNoCache(const base::FilePath& source_dir,
- const base::FilePath& dest_dir) {
- // Try to create the directory if it doesn't already exist.
- if (!CreateDirectory(dest_dir)) {
- if (GetLastError() != ERROR_ALREADY_EXISTS)
- return false;
- }
-
- std::vector<std::wstring> files_copied;
-
- base::FilePath src(source_dir.AppendASCII("*"));
-
- WIN32_FIND_DATA fd;
- HANDLE fh = FindFirstFile(src.value().c_str(), &fd);
- if (fh == INVALID_HANDLE_VALUE)
- return false;
-
- do {
- std::wstring cur_file(fd.cFileName);
- if (cur_file == L"." || cur_file == L"..")
- continue; // Skip these special entries.
-
- base::FilePath cur_source_path = source_dir.Append(cur_file);
- base::FilePath cur_dest_path = dest_dir.Append(cur_file);
-
- if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- // Recursively copy a subdirectory. We stripped "." and ".." already.
- if (!CopyRecursiveDirNoCache(cur_source_path, cur_dest_path)) {
- FindClose(fh);
- return false;
- }
- } else {
- // Copy the file.
- if (!::CopyFile(cur_source_path.value().c_str(),
- cur_dest_path.value().c_str(), false)) {
- FindClose(fh);
- return false;
- }
-
- // We don't check for errors from this function, often, we are copying
- // files that are in the repository, and they will have read-only set.
- // This will prevent us from evicting from the cache, but these don't
- // matter anyway.
- EvictFileFromSystemCache(cur_dest_path);
- }
- } while (FindNextFile(fh, &fd));
-
- FindClose(fh);
- return true;
-}
-
// Checks if the volume supports Alternate Data Streams. This is required for
// the Zone Identifier implementation.
bool VolumeSupportsADS(const base::FilePath& path) {
« no previous file with comments | « base/test/test_file_util_posix.cc ('k') | chrome/test/automation/proxy_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698