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

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: Change RVH to use FileChooserParam mode Created 7 years, 5 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 dca3da8205e97345b1a0efe2b7239c3457f70ab0..5661316987f3c0ba3b3639019715bd318e7c11c1 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());
}
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/browser/child_process_security_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698