diff options
author | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 00:19:17 +0000 |
---|---|---|
committer | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 00:19:17 +0000 |
commit | 98b5bcbd5136888ee6a6d63b5e2d69c85865a86a (patch) | |
tree | 73a0d17e5c40c5a4f4d7e3a1d319a0f735e81180 /webkit/tools | |
parent | bde9617672d03e32e98dfe5f5aa17d3bd568dd54 (diff) | |
download | chromium_src-98b5bcbd5136888ee6a6d63b5e2d69c85865a86a.zip chromium_src-98b5bcbd5136888ee6a6d63b5e2d69c85865a86a.tar.gz chromium_src-98b5bcbd5136888ee6a6d63b5e2d69c85865a86a.tar.bz2 |
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
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 13 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 1 |
3 files changed, 15 insertions, 0 deletions
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. |