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

Side by Side Diff: base/test/test_file_util.h

Issue 448763003: Remove wstring file path helpers from test_file_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/test/test_file_util_posix.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_TEST_FILE_UTIL_H_ 5 #ifndef BASE_TEST_TEST_FILE_UTIL_H_
6 #define BASE_TEST_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>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // the one that set the zone identifier. I.e. don't use it in UI/automation 45 // the one that set the zone identifier. I.e. don't use it in UI/automation
46 // based tests. 46 // based tests.
47 bool HasInternetZoneIdentifier(const FilePath& full_path); 47 bool HasInternetZoneIdentifier(const FilePath& full_path);
48 #endif // defined(OS_WIN) 48 #endif // defined(OS_WIN)
49 49
50 } // namespace base 50 } // namespace base
51 51
52 // TODO(brettw) move all of this to the base namespace. 52 // TODO(brettw) move all of this to the base namespace.
53 namespace file_util { 53 namespace file_util {
54 54
55 // In general it's not reliable to convert a FilePath to a wstring and we use
56 // string16 elsewhere for Unicode strings, but in tests it is frequently
57 // convenient to be able to compare paths to literals like L"foobar".
58 std::wstring FilePathAsWString(const base::FilePath& path);
59 base::FilePath WStringAsFilePath(const std::wstring& path);
60
61 // For testing, make the file unreadable or unwritable. 55 // For testing, make the file unreadable or unwritable.
62 // In POSIX, this does not apply to the root user. 56 // In POSIX, this does not apply to the root user.
63 bool MakeFileUnreadable(const base::FilePath& path) WARN_UNUSED_RESULT; 57 bool MakeFileUnreadable(const base::FilePath& path) WARN_UNUSED_RESULT;
64 bool MakeFileUnwritable(const base::FilePath& path) WARN_UNUSED_RESULT; 58 bool MakeFileUnwritable(const base::FilePath& path) WARN_UNUSED_RESULT;
65 59
66 #if defined(OS_ANDROID) 60 #if defined(OS_ANDROID)
67 // Register the ContentUriTestUrils JNI bindings. 61 // Register the ContentUriTestUrils JNI bindings.
68 bool RegisterContentUriTestUtils(JNIEnv* env); 62 bool RegisterContentUriTestUtils(JNIEnv* env);
69 63
70 // Insert an image file into the MediaStore, and retrieve the content URI for 64 // Insert an image file into the MediaStore, and retrieve the content URI for
(...skipping 11 matching lines...) Expand all
82 const base::FilePath path_; 76 const base::FilePath path_;
83 void* info_; // The opaque stored permission information. 77 void* info_; // The opaque stored permission information.
84 size_t length_; // The length of the stored permission information. 78 size_t length_; // The length of the stored permission information.
85 79
86 DISALLOW_COPY_AND_ASSIGN(PermissionRestorer); 80 DISALLOW_COPY_AND_ASSIGN(PermissionRestorer);
87 }; 81 };
88 82
89 } // namespace file_util 83 } // namespace file_util
90 84
91 #endif // BASE_TEST_TEST_FILE_UTIL_H_ 85 #endif // BASE_TEST_TEST_FILE_UTIL_H_
OLDNEW
« 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