summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt3
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc18
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h2
3 files changed, 20 insertions, 3 deletions
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index c263a51..394e7a1 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -37,9 +37,6 @@ BUGPKASTING : fast/events/continuous-platform-wheelevent-in-scrolling-div.html =
// WebKit 66795. missing one newline (\n) at the end.
BUG54591 MAC : svg/custom/use-invalid-style.svg = TEXT
-// WebKit 66828. missing layoutTestController.setEditingBehavior
-BUG54655 : editing/selection/shift-click.html = TEXT
-
// WebKit 66847. new test.
BUG54656 WIN LINUX : svg/custom/use-invalid-pattern.svg = MISSING
BUG54656 MAC : svg/custom/use-invalid-pattern.svg = TEXT
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())
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index ca66448..668205c 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -200,6 +200,8 @@ class LayoutTestController : public CppBoundClass {
void grantDesktopNotificationPermission(const CppArgumentList& args,
CppVariant* result);
+ void setEditingBehavior(const CppArgumentList&, CppVariant*);
+
// The following are only stubs. TODO(pamg): Implement any of these that
// are needed to pass the layout tests.
void dumpAsWebArchive(const CppArgumentList& args, CppVariant* result);