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

Unified Diff: base/file_util_unittest.cc

Issue 139373004: Fix CopyFileACL on Windows XP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index fc62064b017b65c7dcb3759e4cd4b9ea2b88a4fe..d3c246e42928675bcf08a9e0b242294ba58a30e6 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1417,8 +1417,10 @@ TEST_F(FileUtilTest, CopyFileACL) {
attrs = GetFileAttributes(src.value().c_str());
// Files in the temporary directory should not be indexed ever. If this
// assumption change, fix this unit test accordingly.
- DWORD expected = (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED |
- FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY);
+ // FILE_ATTRIBUTE_NOT_CONTENT_INDEXED doesn't exist on XP.
+ DWORD expected = FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY;
+ if (win::GetVersion() >= win::VERSION_VISTA)
+ expected |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
ASSERT_EQ(expected, attrs);
#else
// On all other platforms, it involves removing the write bit.
@@ -1435,7 +1437,9 @@ TEST_F(FileUtilTest, CopyFileACL) {
// modes are copied.
attrs = GetFileAttributes(src.value().c_str());
ASSERT_EQ(expected, attrs);
- expected = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | FILE_ATTRIBUTE_ARCHIVE;
+ expected = FILE_ATTRIBUTE_ARCHIVE;
+ if (win::GetVersion() >= win::VERSION_VISTA)
+ expected |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
attrs = GetFileAttributes(dst.value().c_str());
ASSERT_EQ(expected, attrs);
#elif defined(OS_MACOSX)
« 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