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

Unified Diff: base/files/file_util_unittest.cc

Issue 906173005: Ignore FILE_ATTRIBUTE_NOT_CONTENT_INDEXED for base unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util_unittest.cc
diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc
index 313ed036dc5ab23770e1bfcb70f88bc26ec48871..de380838a9dc91a8413798a0dc25e33c4f84afa9 100644
--- a/base/files/file_util_unittest.cc
+++ b/base/files/file_util_unittest.cc
@@ -1388,19 +1388,15 @@ void SetReadOnly(const FilePath& path, bool read_only) {
path.value().c_str(),
read_only ? (attrs | FILE_ATTRIBUTE_READONLY) :
(attrs & ~FILE_ATTRIBUTE_READONLY)));
- // Files in the temporary directory should not be indexed ever. If this
- // assumption change, fix this unit test accordingly.
- // FILE_ATTRIBUTE_NOT_CONTENT_INDEXED doesn't exist on XP.
+
DWORD expected = read_only ?
((attrs & (FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_DIRECTORY)) |
FILE_ATTRIBUTE_READONLY) :
(attrs & (FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_DIRECTORY));
- // TODO(ripp@yandex-team.ru): this seems out of place here. If we really think
- // it is important to verify that temp files are not indexed there should be
- // a dedicated test for that (create a file, inspect the attributes)
- if (win::GetVersion() >= win::VERSION_VISTA)
- expected |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
- attrs = GetFileAttributes(path.value().c_str());
+
+ // Ignore FILE_ATTRIBUTE_NOT_CONTENT_INDEXED if present.
+ attrs = GetFileAttributes(path.value().c_str()) &
+ ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
ASSERT_EQ(expected, attrs);
#else
// On all other platforms, it involves removing/setting the write bit.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698