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

Side by Side Diff: webrtc/test/testsupport/fileutils.h

Issue 2872283002: Reduce dependencies on rtc::FileSystem in FileRotatingStream tests, adding helpers in webrtc::test:: (Closed)
Patch Set: Addressed nits. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/filerotatingstream_unittest.cc ('k') | webrtc/test/testsupport/fileutils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Gets the current working directory for the executing program. 64 // Gets the current working directory for the executing program.
65 // Returns "./" if for some reason it is not possible to find the working 65 // Returns "./" if for some reason it is not possible to find the working
66 // directory. 66 // directory.
67 std::string WorkingDir(); 67 std::string WorkingDir();
68 68
69 // Creates a directory if it not already exists. 69 // Creates a directory if it not already exists.
70 // Returns true if successful. Will print an error message to stderr and return 70 // Returns true if successful. Will print an error message to stderr and return
71 // false if a file with the same name already exists. 71 // false if a file with the same name already exists.
72 bool CreateDir(const std::string& directory_name); 72 bool CreateDir(const std::string& directory_name);
73 73
74 // Removes a directory, which must already be empty.
75 bool RemoveDir(const std::string& directory_name);
76
77 // Removes a file.
78 bool RemoveFile(const std::string& file_name);
79
74 // Checks if a file exists. 80 // Checks if a file exists.
75 bool FileExists(const std::string& file_name); 81 bool FileExists(const std::string& file_name);
76 82
77 // Checks if a directory exists. 83 // Checks if a directory exists.
78 bool DirExists(const std::string& directory_name); 84 bool DirExists(const std::string& directory_name);
79 85
80 // File size of the supplied file in bytes. Will return 0 if the file is 86 // File size of the supplied file in bytes. Will return 0 if the file is
81 // empty or if the file does not exist/is readable. 87 // empty or if the file does not exist/is readable.
82 size_t GetFileSize(const std::string& filename); 88 size_t GetFileSize(const std::string& filename);
83 89
84 // Sets the executable path, i.e. the path to the executable that is being used 90 // Sets the executable path, i.e. the path to the executable that is being used
85 // when launching it. This is usually the path relative to the working directory 91 // when launching it. This is usually the path relative to the working directory
86 // but can also be an absolute path. The intention with this function is to pass 92 // but can also be an absolute path. The intention with this function is to pass
87 // the argv[0] being sent into the main function to make it possible for 93 // the argv[0] being sent into the main function to make it possible for
88 // fileutils.h to find the correct project paths even when the working directory 94 // fileutils.h to find the correct project paths even when the working directory
89 // is outside the project tree (which happens in some cases). 95 // is outside the project tree (which happens in some cases).
90 void SetExecutablePath(const std::string& path_to_executable); 96 void SetExecutablePath(const std::string& path_to_executable);
91 97
92 } // namespace test 98 } // namespace test
93 } // namespace webrtc 99 } // namespace webrtc
94 100
95 #endif // WEBRTC_TEST_TESTSUPPORT_FILEUTILS_H_ 101 #endif // WEBRTC_TEST_TESTSUPPORT_FILEUTILS_H_
OLDNEW
« no previous file with comments | « webrtc/base/filerotatingstream_unittest.cc ('k') | webrtc/test/testsupport/fileutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698