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

Unified Diff: content/browser/child_process_security_policy_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/child_process_security_policy_unittest.cc
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc
index 4d0dc9d10ac3b03db7f15b82e1a65c355b834ad9..1cb7086b039c322ab0152b61c2766cc0340c012e 100644
--- a/content/browser/child_process_security_policy_unittest.cc
+++ b/content/browser/child_process_security_policy_unittest.cc
@@ -78,6 +78,13 @@ class ChildProcessSecurityPolicyTest : public testing::Test {
test_browser_client_.AddScheme(scheme);
}
+ void GrantPermissionsForFile(ChildProcessSecurityPolicyImpl* p,
+ int child_id,
+ const base::FilePath& file,
+ int permissions) {
+ p->GrantPermissionsForFile(child_id, file, permissions);
+ }
+
private:
ChildProcessSecurityPolicyTestBrowserClient test_browser_client_;
ContentBrowserClient* old_browser_client_;
@@ -356,7 +363,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, granted_file,
base::PLATFORM_FILE_OPEN));
- p->GrantPermissionsForFile(kRendererID, granted_file,
+ GrantPermissionsForFile(p, kRendererID, granted_file,
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_OPEN_TRUNCATED |
base::PLATFORM_FILE_READ |
@@ -408,7 +415,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
p->Add(kRendererID);
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, granted_file,
base::PLATFORM_FILE_OPEN));
- p->GrantPermissionsForFile(kRendererID, parent_file,
+ GrantPermissionsForFile(p, kRendererID, parent_file,
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ);
EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, granted_file,
@@ -422,7 +429,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
p->Add(kRendererID);
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, granted_file,
base::PLATFORM_FILE_OPEN));
- p->GrantPermissionsForFile(kRendererID, parent_slash_file,
+ GrantPermissionsForFile(p, kRendererID, parent_slash_file,
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ);
EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, granted_file,
@@ -433,7 +440,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
// Grant permissions for the file (should overwrite the permissions granted
// for the directory).
- p->GrantPermissionsForFile(kRendererID, granted_file,
+ GrantPermissionsForFile(p, kRendererID, granted_file,
base::PLATFORM_FILE_TEMPORARY);
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, granted_file,
base::PLATFORM_FILE_OPEN));
@@ -453,7 +460,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
// Grant file permissions for the file to main thread renderer process,
// make sure its worker thread renderer process inherits those.
p->Add(kRendererID);
- p->GrantPermissionsForFile(kRendererID, granted_file,
+ GrantPermissionsForFile(p, kRendererID, granted_file,
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ);
EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, granted_file,
@@ -474,7 +481,7 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) {
p->Remove(kWorkerRendererID);
p->Add(kRendererID);
- p->GrantPermissionsForFile(kRendererID, relative_file,
+ GrantPermissionsForFile(p, kRendererID, relative_file,
base::PLATFORM_FILE_OPEN);
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, relative_file,
base::PLATFORM_FILE_OPEN));
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698