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

Unified Diff: base/test/test_file_util.h

Issue 9355050: Added read-only file error test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk. Created 8 years, 9 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 | « no previous file | base/test/test_file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_file_util.h
diff --git a/base/test/test_file_util.h b/base/test/test_file_util.h
index ce0b30259371cd845ab90d45f592a395cb82b5da..b5407e12f5c69d2684550b3b709034d08c765aaa 100644
--- a/base/test/test_file_util.h
+++ b/base/test/test_file_util.h
@@ -11,6 +11,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/file_path.h"
class FilePath;
@@ -56,6 +57,20 @@ FilePath WStringAsFilePath(const std::wstring& path);
bool MakeFileUnreadable(const FilePath& path) WARN_UNUSED_RESULT;
bool MakeFileUnwritable(const FilePath& path) WARN_UNUSED_RESULT;
+// Saves the current permissions for a path, and restores it on destruction.
+class PermissionRestorer {
+ public:
+ explicit PermissionRestorer(const FilePath& path);
+ ~PermissionRestorer();
+
+ private:
+ const FilePath path_;
+ void* info_; // The opaque stored permission information.
+ size_t length_; // The length of the stored permission information.
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionRestorer);
+};
+
} // namespace file_util
#endif // BASE_TEST_TEST_FILE_UTIL_H_
« no previous file with comments | « no previous file | base/test/test_file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698