diff options
author | brucedawson <brucedawson@chromium.org> | 2015-09-17 13:30:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-17 20:31:35 +0000 |
commit | 35b35d85da7746865bc66f3dee35487567e0a356 (patch) | |
tree | e100206367e78ecef331c6c8f1881a7f8de2f9a7 | |
parent | 9435a3ae9562f411d4dae7c8b1faa16f54f15163 (diff) | |
download | chromium_src-35b35d85da7746865bc66f3dee35487567e0a356.zip chromium_src-35b35d85da7746865bc66f3dee35487567e0a356.tar.gz chromium_src-35b35d85da7746865bc66f3dee35487567e0a356.tar.bz2 |
Fix three Windows base_unittests to not require admin
These three base_unittests tests fail when run as non-admin on Windows
if %temp% is set to a non-standard location such as d:\src\temp:
- FileTest.GetInfoForDirectory
- FileUtilTest.FileEnumeratorTest
- FileUtilTest.NormalizeFilePathReparsePoints
They all fail because the default user doesn't have enough permissions
to open the directories with FILE_ALL_ACCESS.
Asking for fewer permissions allows the tests to pass regardless of
user-type and %temp% location.
R=rvargas@chromium.org
BUG=533018
Review URL: https://codereview.chromium.org/1348533003
Cr-Commit-Position: refs/heads/master@{#349485}
-rw-r--r-- | base/files/file_unittest.cc | 2 | ||||
-rw-r--r-- | base/files/file_util_unittest.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/base/files/file_unittest.cc b/base/files/file_unittest.cc index 3d60b2c..fd79a37 100644 --- a/base/files/file_unittest.cc +++ b/base/files/file_unittest.cc @@ -495,7 +495,7 @@ TEST(FileTest, GetInfoForDirectory) { base::File dir( ::CreateFile(empty_dir.value().c_str(), - FILE_ALL_ACCESS, + GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc index 4b95dbb..933cb7f 100644 --- a/base/files/file_util_unittest.cc +++ b/base/files/file_util_unittest.cc @@ -134,7 +134,7 @@ class ReparsePoint { ReparsePoint(const FilePath& source, const FilePath& target) { dir_.Set( ::CreateFile(source.value().c_str(), - FILE_ALL_ACCESS, + GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, |