summaryrefslogtreecommitdiffstats
path: root/content/shell/webkit_test_controller.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 02:03:58 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 02:03:58 +0000
commit08585c81cfaca300c2af792f21b0f0c3ba261e01 (patch)
treeee5060c7b48f4ab1673a96c1cfc28940f2dbc262 /content/shell/webkit_test_controller.cc
parentea7f83787239ae91db4ec297225905b0c8a5a595 (diff)
downloadchromium_src-08585c81cfaca300c2af792f21b0f0c3ba261e01.zip
chromium_src-08585c81cfaca300c2af792f21b0f0c3ba261e01.tar.gz
chromium_src-08585c81cfaca300c2af792f21b0f0c3ba261e01.tar.bz2
Make Isolated filesystem layout tests runnable in content_browsertests
- Add grant permission code in WebKitTestController::OnRegisterIsolatedFileSystem (which wasn't necessary in single-process DRT code) - Pass layout_test_dir_ to PrepareForLayoutTest BUG=156563 TEST=FileSystemLayoutTest.CrossFilesystemOp Review URL: https://codereview.chromium.org/11819032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/webkit_test_controller.cc')
-rw-r--r--content/shell/webkit_test_controller.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index 99bc1efa..ef4b5e63 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -13,6 +13,7 @@
#include "base/run_loop.h"
#include "base/string_number_conversions.h"
#include "base/stringprintf.h"
+#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -495,10 +496,18 @@ void WebKitTestController::OnRegisterIsolatedFileSystem(
const std::vector<FilePath>& absolute_filenames,
std::string* filesystem_id) {
fileapi::IsolatedContext::FileInfoSet files;
- for (size_t i = 0; i < absolute_filenames.size(); ++i)
+ ChildProcessSecurityPolicy* policy =
+ ChildProcessSecurityPolicy::GetInstance();
+ int renderer_id = main_window_->web_contents()->GetRenderViewHost()->
+ GetProcess()->GetID();
+ for (size_t i = 0; i < absolute_filenames.size(); ++i) {
files.AddPath(absolute_filenames[i], NULL);
+ if (!policy->CanReadFile(renderer_id, absolute_filenames[i]))
+ policy->GrantReadFile(renderer_id, absolute_filenames[i]);
+ }
*filesystem_id =
fileapi::IsolatedContext::GetInstance()->RegisterDraggedFileSystem(files);
+ policy->GrantReadFileSystem(renderer_id, *filesystem_id);
}
void WebKitTestController::OnNotImplemented(