summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/layout_test_controller.cc
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 08:14:25 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 08:14:25 +0000
commite606117a965d357f7c95862384d170d292a23ae2 (patch)
tree5f8a11bb58dd88406b766103b95fe55486f693d8 /webkit/tools/test_shell/layout_test_controller.cc
parentf69cf55f93554571115934b239dd61154417deb2 (diff)
downloadchromium_src-e606117a965d357f7c95862384d170d292a23ae2.zip
chromium_src-e606117a965d357f7c95862384d170d292a23ae2.tar.gz
chromium_src-e606117a965d357f7c95862384d170d292a23ae2.tar.bz2
Add layoutTestController::setEditingBehavior in test_shell
BUG=54655 TEST=editing/selection/shift-click.html passes Review URL: http://codereview.chromium.org/3350011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58675 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.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index a04d22e..7bd9222 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -25,6 +25,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSettings.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
@@ -185,6 +186,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
BindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
BindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+ BindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior);
BindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
BindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
@@ -1359,6 +1361,22 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& args,
shell_->webView()->addUserStyleSheet(WebString::fromUTF8(args[0].ToString()));
}
+void LayoutTestController::setEditingBehavior(const CppArgumentList& args,
+ CppVariant* result) {
+ result->SetNull();
+ WebString key = WebString::fromUTF8(args[0].ToString());
+ if (key == "mac") {
+ shell_->webView()->settings()->setEditingBehavior(
+ WebKit::WebSettings::EditingBehaviorMac);
+ } else if (key == "win") {
+ shell_->webView()->settings()->setEditingBehavior(
+ WebKit::WebSettings::EditingBehaviorWin);
+ } else {
+ LogErrorToConsole("Passed invalid editing bahavior. "
+ "Should be 'mac' or 'win'.");
+ }
+}
+
void LayoutTestController::setGeolocationPermission(const CppArgumentList& args,
CppVariant* result) {
if (args.size() < 1 || !args[0].isBool())