Index: webkit/tools/test_shell/layout_test_controller.cc |
=================================================================== |
--- webkit/tools/test_shell/layout_test_controller.cc (revision 39304) |
+++ webkit/tools/test_shell/layout_test_controller.cc (working copy) |
@@ -152,6 +152,7 @@ |
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 @@ |
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) { |