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

Unified Diff: content/browser/child_process_security_policy_unittest.cc

Issue 6912001: Merge 83754 - blob_storage_controller.cc assert from this bug was caused by the fact that worker ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 8 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
===================================================================
--- content/browser/child_process_security_policy_unittest.cc (revision 83771)
+++ content/browser/child_process_security_policy_unittest.cc (working copy)
@@ -27,6 +27,7 @@
};
static int kRendererID = 42;
+static int kWorkerRendererID = kRendererID + 1;
TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) {
ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance();
@@ -349,6 +350,28 @@
EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, file,
base::PLATFORM_FILE_TEMPORARY));
p->Remove(kRendererID);
+
+ // 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, file, base::PLATFORM_FILE_OPEN |
+ base::PLATFORM_FILE_READ);
+ EXPECT_TRUE(p->HasPermissionsForFile(kRendererID, file,
+ base::PLATFORM_FILE_OPEN |
+ base::PLATFORM_FILE_READ));
+ EXPECT_FALSE(p->HasPermissionsForFile(kRendererID, file,
+ base::PLATFORM_FILE_WRITE));
+ p->AddWorker(kWorkerRendererID, kRendererID);
+ EXPECT_TRUE(p->HasPermissionsForFile(kWorkerRendererID, file,
+ base::PLATFORM_FILE_OPEN |
+ base::PLATFORM_FILE_READ));
+ EXPECT_FALSE(p->HasPermissionsForFile(kWorkerRendererID, file,
+ base::PLATFORM_FILE_WRITE));
+ p->Remove(kRendererID);
+ EXPECT_FALSE(p->HasPermissionsForFile(kWorkerRendererID, file,
+ base::PLATFORM_FILE_OPEN |
+ base::PLATFORM_FILE_READ));
+ p->Remove(kWorkerRendererID);
}
TEST_F(ChildProcessSecurityPolicyTest, CanServiceWebUIBindings) {
« no previous file with comments | « content/browser/child_process_security_policy.cc ('k') | content/browser/worker_host/worker_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698