diff options
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index fbedf9c..f400ce0 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -140,6 +140,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) : BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); BindMethod("overridePreference", &LayoutTestController::overridePreference); + BindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs); // The fallback method is called when an unknown method is invoked. BindFallbackMethod(&LayoutTestController::fallbackMethod); @@ -843,6 +844,16 @@ void LayoutTestController::evaluateScriptInIsolatedWorld( result->SetNull(); } +void LayoutTestController::setAllowUniversalAccessFromFileURLs( + const CppArgumentList& args, CppVariant* result) { + if (args.size() > 0 && args[0].isBool()) { + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->allow_universal_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 d84d5cb..1ddb879 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -187,6 +187,7 @@ class LayoutTestController : public CppBoundClass { void setXSSAuditorEnabled(const CppArgumentList& args, CppVariant* result); void evaluateScriptInIsolatedWorld(const CppArgumentList& args, CppVariant* result); void overridePreference(const CppArgumentList& args, CppVariant* result); + void setAllowUniversalAccessFromFileURLs(const CppArgumentList& args, CppVariant* result); // The fallback method is called when a nonexistent method is called on // the layout test controller object. |