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

Review URL: https://codereview.chromium.org/136693004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244947 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed