diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 22:00:04 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 22:00:04 +0000 |
commit | b2f2308d0c635418caa3ad2a2560a2778d70a4d5 (patch) | |
tree | daaa5177eb28ddcb2d5582a4e78cf7b0318aea07 /content/browser/child_process_security_policy_unittest.cc | |
parent | 10b6e62953ff6ebc0ac9e7cb7628677da273f79b (diff) | |
download | chromium_src-b2f2308d0c635418caa3ad2a2560a2778d70a4d5.zip chromium_src-b2f2308d0c635418caa3ad2a2560a2778d70a4d5.tar.gz chromium_src-b2f2308d0c635418caa3ad2a2560a2778d70a4d5.tar.bz2 |
Fix PP_FileOpenFlags_Dev handling:
- rewrite the mapping from PP_FileOpenFlags_Dev to PlatformFileFlags.
- let ppb_flash_file_impl and ppb_file_io_impl use the same mapping logic.
- CreatePlatformFile: resolve the conflict between the win and posix implementation. Before this change, the win implementation didn't allow PLATFORM_FILE_TRUNCATE to be used with any of the (OPEN|CREATE)(_ALWAYS)? flags; while the posix implementation required it to be used with them.
- add more test cases to test the behavior of different PP_FileOpenFlags_Dev combinations.
- also unify the conversion from PlatformFileError to Pepper error.
BUG=68489
TEST=New test cases in test_file_io.cc
Review URL: http://codereview.chromium.org/7038032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/child_process_security_policy_unittest.cc')
-rw-r--r-- | content/browser/child_process_security_policy_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index 0ee30f8..632aabb 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc @@ -286,14 +286,14 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) { p->GrantPermissionsForFile(kRendererID, file, base::PLATFORM_FILE_OPEN | + base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_WRITE | - base::PLATFORM_FILE_TRUNCATE); + base::PLATFORM_FILE_WRITE); EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, file, base::PLATFORM_FILE_OPEN | + base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_WRITE | - base::PLATFORM_FILE_TRUNCATE)); + base::PLATFORM_FILE_WRITE)); EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, file, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ)); @@ -301,9 +301,9 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) { base::PLATFORM_FILE_CREATE)); EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, file, base::PLATFORM_FILE_CREATE | + base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_READ | - base::PLATFORM_FILE_WRITE | - base::PLATFORM_FILE_TRUNCATE)); + base::PLATFORM_FILE_WRITE)); p->Remove(kRendererID); // Grant permissions for the directory the file is in. |