bool HasInternetZoneIdentifier(const FilePath& full_path);
#endif // defined(OS_WIN)
-} // namespace base
-
-// TODO(brettw) move all of this to the base namespace.
-namespace file_util {
-
-// In general it's not reliable to convert a FilePath to a wstring and we use
-// string16 elsewhere for Unicode strings, but in tests it is frequently
-// convenient to be able to compare paths to literals like L"foobar".
-std::wstring FilePathAsWString(const base::FilePath& path);
-base::FilePath WStringAsFilePath(const std::wstring& path);
-
// For testing, make the file unreadable or unwritable.
// In POSIX, this does not apply to the root user.
-bool MakeFileUnreadable(const base::FilePath& path) WARN_UNUSED_RESULT;
-bool MakeFileUnwritable(const base::FilePath& path) WARN_UNUSED_RESULT;
-
-#if defined(OS_ANDROID)
-// Register the ContentUriTestUrils JNI bindings.
-bool RegisterContentUriTestUtils(JNIEnv* env);
-
-// Insert an image file into the MediaStore, and retrieve the content URI for
-// testing purpose.
-base::FilePath InsertImageIntoMediaStore(const base::FilePath& path);
-#endif // defined(OS_ANDROID)
+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 {
+class FilePermissionRestorer {
public:
- explicit PermissionRestorer(const base::FilePath& path);
- ~PermissionRestorer();
+ explicit FilePermissionRestorer(const FilePath& path);
+ ~FilePermissionRestorer();
private:
- const base::FilePath path_;
+ 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);
+ DISALLOW_COPY_AND_ASSIGN(FilePermissionRestorer);
};
-} // namespace file_util
+#if defined(OS_ANDROID)
+// Register the ContentUriTestUrils JNI bindings.
+bool RegisterContentUriTestUtils(JNIEnv* env);
+
+// Insert an image file into the MediaStore, and retrieve the content URI for
+// testing purpose.
+FilePath InsertImageIntoMediaStore(const FilePath& path);
+#endif // defined(OS_ANDROID)
+
+} // namespace base
#endif // BASE_TEST_TEST_FILE_UTIL_H_