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

Issue 136693004: Make all the files mapped in when running base_unittests read only. (Closed)

Created:
6 years, 11 months ago by M-A Ruel
Modified:
6 years, 11 months ago
Reviewers:
Vadim Sh., Nico
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Make all the files mapped in when running base_unittests read only. This means no file can be opened for write during the test run. Make CopyFileUnsafe() reset the RO bit on Windows. Add a tests that confirms the current CopyFile() behavior: - On Windows, CopyFile() copies the ACL but now strips the READONLY bit. - On OSX, CopyFile() copies the ACL. - On anything else, ACL is not copied. Rationale: On anything-but-Windows, deleting a file require write access on the directory. On Windows, deleting a file require not having the RO bit on the file. CopyFile() affects the file but not the directory. On isolated testing, the read only bit will be set on the file being copied, causing the test to fail to delete the files. This has wide implications in the unit tests. CopyFile() is mostly (but not exclusively) used in unit tests. R=thakis@chromium.org, vadimsh@chromium.org BUG=116251 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244947

Patch Set 1 #

Patch Set 2 : Fix CopyFile() on Windows #

Total comments: 4

Patch Set 3 : Add new unit test CopyFileACL #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -2 lines) Patch
M base/base_unittests.isolate View 1 chunk +1 line, -0 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 1 chunk +54 lines, -0 lines 1 comment Download
M base/file_util_win.cc View 1 2 1 chunk +18 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
M-A Ruel
It passed on linux and OSX. Waiting for Windows result. If it passes Windows, it'll ...
6 years, 11 months ago (2014-01-13 18:32:52 UTC) #1
M-A Ruel
On 2014/01/13 18:32:52, M-A Ruel wrote: > It passed on linux and OSX. Waiting for ...
6 years, 11 months ago (2014-01-13 19:12:56 UTC) #2
Vadim Sh.
On 2014/01/13 18:32:52, M-A Ruel wrote: > It passed on linux and OSX. Waiting for ...
6 years, 11 months ago (2014-01-13 19:18:29 UTC) #3
M-A Ruel
On 2014/01/13 19:18:29, Vadim Sh. wrote: > On 2014/01/13 18:32:52, M-A Ruel wrote: > > ...
6 years, 11 months ago (2014-01-14 00:13:46 UTC) #4
Nico
OS X also copies the the acl bits (see http://www.manpagez.com/man/3/copyfile/ , we use COPYFILE_ALL). Having ...
6 years, 11 months ago (2014-01-14 02:30:33 UTC) #5
M-A Ruel
On 2014/01/14 02:30:33, Nico wrote: > OS X also copies the the acl bits (see ...
6 years, 11 months ago (2014-01-14 14:59:38 UTC) #6
M-A Ruel
http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/117137/steps/base_unittests/logs/stdio is a real bug, looking into it.
6 years, 11 months ago (2014-01-14 17:41:20 UTC) #7
Nico
So it sounds like this CL changes things from "2 platforms keep attributes, 1 doesn't" ...
6 years, 11 months ago (2014-01-14 19:52:11 UTC) #8
M-A Ruel
On 2014/01/14 19:52:11, Nico wrote: > So it sounds like this CL changes things from ...
6 years, 11 months ago (2014-01-14 22:40:38 UTC) #9
Nico
On 2014/01/14 22:40:38, M-A Ruel wrote: > On 2014/01/14 19:52:11, Nico wrote: > > So ...
6 years, 11 months ago (2014-01-15 05:38:20 UTC) #10
M-A Ruel
On 2014/01/15 05:38:20, Nico wrote: > ^ lgtm with this in the CL description. Done. ...
6 years, 11 months ago (2014-01-15 15:30:21 UTC) #11
M-A Ruel
On 2014/01/15 15:30:21, M-A Ruel wrote: > On 2014/01/15 05:38:20, Nico wrote: > > ^ ...
6 years, 11 months ago (2014-01-15 18:45:42 UTC) #12
M-A Ruel
6 years, 11 months ago (2014-01-15 18:48:46 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 manually as r244947 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698