summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 04:18:25 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 04:18:25 +0000
commitbed2242142e1dda956947ce6bf2429fe44922c1c (patch)
treeea0cb014a7eb410cc1783d8801f4f8ac7f98649c /webkit/tools/test_shell
parent70aa23a21ac0d7a3f136b1e8acda479edd2b8cd7 (diff)
downloadchromium_src-bed2242142e1dda956947ce6bf2429fe44922c1c.zip
chromium_src-bed2242142e1dda956947ce6bf2429fe44922c1c.tar.gz
chromium_src-bed2242142e1dda956947ce6bf2429fe44922c1c.tar.bz2
Chromium plumbing for new file:// security flag, including test_shell support.
This change does not alter behaviour but will enable a WebKit test to be written. BUG=4197 TEST=WebKit test pending TBR=abarth Review URL: http://codereview.chromium.org/625009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc11
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h1
-rw-r--r--webkit/tools/test_shell/test_shell.cc1
3 files changed, 13 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index 0552538d..f06de24 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -152,6 +152,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
BindMethod("overridePreference", &LayoutTestController::overridePreference);
BindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
+ BindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
BindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
BindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
BindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
@@ -899,6 +900,16 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(
result->SetNull();
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(
+ const CppArgumentList& args, CppVariant* result) {
+ if (args.size() > 0 && args[0].isBool()) {
+ WebPreferences* prefs = shell_->GetWebPreferences();
+ prefs->allow_file_access_from_file_urls = args[0].value.boolValue;
+ prefs->Apply(shell_->webView());
+ }
+ result->SetNull();
+}
+
// Need these conversions because the format of the value for booleans
// may vary - for example, on mac "1" and "0" are used for boolean.
bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index 8705468..50d7c91 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -199,6 +199,7 @@ class LayoutTestController : public CppBoundClass {
void evaluateScriptInIsolatedWorld(const CppArgumentList& args, CppVariant* result);
void overridePreference(const CppArgumentList& args, CppVariant* result);
void setAllowUniversalAccessFromFileURLs(const CppArgumentList& args, CppVariant* result);
+ void setAllowFileAccessFromFileURLs(const CppArgumentList& args, CppVariant* result);
// The fallback method is called when a nonexistent method is called on
// the layout test controller object.
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 8d37a81..f7449b5 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -464,6 +464,7 @@ void TestShell::ResetWebPreferences() {
web_prefs_->local_storage_enabled = true;
web_prefs_->application_cache_enabled = true;
web_prefs_->databases_enabled = true;
+ web_prefs_->allow_file_access_from_file_urls = true;
// LayoutTests were written with Safari Mac in mind which does not allow
// tabbing to links by default.
web_prefs_->tabs_to_links = false;