From 98b5bcbd5136888ee6a6d63b5e2d69c85865a86a Mon Sep 17 00:00:00 2001 From: "inferno@chromium.org" Date: Tue, 4 May 2010 00:19:17 +0000 Subject: Update Webkit 58626:58719. Make use of new setting for disabling clipboard access, already added in webkit as part of fix - https://bugs.webkit.org/show_bug.cgi?id=27751. Enable the setting in Test framework. Also, provide a command-line switch for this setting. BUG=41654 TEST=None Review URL: http://codereview.chromium.org/1815005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46299 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/tools/test_shell/layout_test_controller.cc | 13 +++++++++++++ webkit/tools/test_shell/layout_test_controller.h | 1 + webkit/tools/test_shell/test_shell.cc | 1 + 3 files changed, 15 insertions(+) (limited to 'webkit/tools') diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 7643217..bcc70fb 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -157,6 +157,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) : BindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); + BindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard); BindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); BindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); BindMethod("overridePreference", &LayoutTestController::overridePreference); @@ -929,6 +930,16 @@ void LayoutTestController::setPrivateBrowsingEnabled( result->SetNull(); } +void LayoutTestController::setJavaScriptCanAccessClipboard( + const CppArgumentList& args, CppVariant* result) { + if (args.size() > 0 && args[0].isBool()) { + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->javascript_can_access_clipboard = args[0].value.boolValue; + prefs->Apply(shell_->webView()); + } + result->SetNull(); +} + void LayoutTestController::setXSSAuditorEnabled( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isBool()) { @@ -1060,6 +1071,8 @@ void LayoutTestController::overridePreference( preferences->java_enabled = CppVariantToBool(value); else if (key == "WebKitUsesPageCachePreferenceKey") preferences->uses_page_cache = CppVariantToBool(value); + else if (key == "WebKitJavaScriptCanAccessClipboard") + preferences->javascript_can_access_clipboard = CppVariantToBool(value); else if (key == "WebKitXSSAuditorEnabled") preferences->xss_auditor_enabled = CppVariantToBool(value); else if (key == "WebKitLocalStorageEnabledPreferenceKey") diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 3a29544..0dc04df 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -213,6 +213,7 @@ class LayoutTestController : public CppBoundClass { void setCallCloseOnWebViews(const CppArgumentList& args, CppVariant* result); void setPrivateBrowsingEnabled(const CppArgumentList& args, CppVariant* result); + void setJavaScriptCanAccessClipboard(const CppArgumentList& args, CppVariant* result); void setXSSAuditorEnabled(const CppArgumentList& args, CppVariant* result); void evaluateScriptInIsolatedWorld(const CppArgumentList& args, CppVariant* result); void overridePreference(const CppArgumentList& args, CppVariant* result); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index b67f5b5..564979c 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -485,6 +485,7 @@ void TestShell::ResetWebPreferences() { web_prefs_->text_areas_are_resizable = false; web_prefs_->java_enabled = false; web_prefs_->allow_scripts_to_close_windows = false; + web_prefs_->javascript_can_access_clipboard = true; web_prefs_->xss_auditor_enabled = false; // It's off by default for Chrome, but we don't want to // lose the coverage of dynamic font tests in webkit test. -- cgit v1.1