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

Unified Diff: content/browser/renderer_host/render_view_host_unittest.cc

Issue 18129002: Update the child process security policy to use explicit permission grants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
Index: content/browser/renderer_host/render_view_host_unittest.cc
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index 2dc55582e691df9c5e0e26830e47aaa4406df0da..74d85fdfa74e766da7836d3db058451d50b9d9f0 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -267,12 +267,8 @@ TEST_F(RenderViewHostTest, MessageWithBadHistoryItemFiles) {
test_rvh()->TestOnUpdateStateWithFile(process()->GetID(), file_path);
EXPECT_EQ(1, process()->bad_msg_count());
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile(
- process()->GetID(), file_path,
- base::PLATFORM_FILE_OPEN |
- base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_EXCLUSIVE_READ |
- base::PLATFORM_FILE_ASYNC);
+ ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
+ process()->GetID(), file_path);
test_rvh()->TestOnUpdateStateWithFile(process()->GetID(), file_path);
EXPECT_EQ(1, process()->bad_msg_count());
}
@@ -286,12 +282,8 @@ TEST_F(RenderViewHostTest, NavigationWithBadHistoryItemFiles) {
test_rvh()->SendNavigateWithFile(1, url, file_path);
EXPECT_EQ(1, process()->bad_msg_count());
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile(
- process()->GetID(), file_path,
- base::PLATFORM_FILE_OPEN |
- base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_EXCLUSIVE_READ |
- base::PLATFORM_FILE_ASYNC);
+ ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
+ process()->GetID(), file_path);
test_rvh()->SendNavigateWithFile(process()->GetID(), url, file_path);
EXPECT_EQ(1, process()->bad_msg_count());
}

Powered by Google App Engine
This is Rietveld 408576698