diff options
author | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 22:21:30 +0000 |
---|---|---|
committer | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 22:21:30 +0000 |
commit | 51fdaa72c37fb7915f8ea13349fa4f80fd11d84d (patch) | |
tree | 1c5cff7753cf209be4cab1f92b7f47596798c076 /webkit/tools/test_shell/layout_test_controller.cc | |
parent | 9a8f8cef87a8a49bb5637d5b20883f8e7548848c (diff) | |
download | chromium_src-51fdaa72c37fb7915f8ea13349fa4f80fd11d84d.zip chromium_src-51fdaa72c37fb7915f8ea13349fa4f80fd11d84d.tar.gz chromium_src-51fdaa72c37fb7915f8ea13349fa4f80fd11d84d.tar.bz2 |
Implement setXSSAuditorEnabled for test_shell
BUG=15649
BUG=15132
BUG=14889
BUG=14773
TEST=no layout test regressions
R=abarth
Review URL: http://codereview.chromium.org/151092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/layout_test_controller.cc')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 12 |
1 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 02797a1..fd30eb8 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -133,6 +133,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) { BindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); + BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); + // The fallback method is called when an unknown method is invoked. BindFallbackMethod(&LayoutTestController::fallbackMethod); @@ -759,6 +761,16 @@ void LayoutTestController::setPrivateBrowsingEnabled( result->SetNull(); } +void LayoutTestController::setXSSAuditorEnabled( + const CppArgumentList& args, CppVariant* result) { + if (args.size() > 0 && args[0].isBool()) { + WebPreferences* preferences = shell_->GetWebPreferences(); + preferences->xss_auditor_enabled = args[0].value.boolValue; + shell_->webView()->SetPreferences(*preferences); + } + result->SetNull(); +} + void LayoutTestController::fallbackMethod( const CppArgumentList& args, CppVariant* result) { std::wstring message(L"JavaScript ERROR: unknown method called on LayoutTestController"); |