summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/layout_test_controller.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 22:08:40 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 22:08:40 +0000
commitaf91a57c0203abee45565f47b5d9086e42acafba (patch)
tree7cc4db4b0eec56b116d2e4e43cb98e629967cd2a /webkit/tools/test_shell/layout_test_controller.cc
parentfa2738d71ffcd2c451ecbb27fa35af8534d5482c (diff)
downloadchromium_src-af91a57c0203abee45565f47b5d9086e42acafba.zip
chromium_src-af91a57c0203abee45565f47b5d9086e42acafba.tar.gz
chromium_src-af91a57c0203abee45565f47b5d9086e42acafba.tar.bz2
Adds support for pauseAnimationAtTimeOnElementWithId and
pauseTransitionAtTimeOnElementWithId to layout test controller so that we can pass a couple of additional tests. BUG=5801 TEST=none Review URL: http://codereview.chromium.org/16216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7379 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.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index c6a3588..df1a774 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -14,6 +14,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "webkit/glue/dom_operations.h"
#include "webkit/glue/webframe.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/webview.h"
@@ -97,6 +98,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) {
BindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
BindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
BindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
+ BindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
+ BindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
// The following are stubs.
BindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
@@ -568,6 +571,39 @@ void LayoutTestController::setSelectTrailingWhitespaceEnabled(
result->SetNull();
}
+void LayoutTestController::pauseAnimationAtTimeOnElementWithId(
+ const CppArgumentList& args,
+ CppVariant* result) {
+ if (args.size() > 2 && args[0].isString() && args[1].isNumber() &&
+ args[2].isString()) {
+ std::string animation_name = args[0].ToString();
+ double time = args[1].ToDouble();
+ std::string element_id = args[2].ToString();
+
+ result->Set(
+ webkit_glue::PauseAnimationAtTimeOnElementWithId(
+ shell_->webView(), animation_name, time, element_id));
+ } else {
+ result->Set(false);
+ }
+}
+
+void LayoutTestController::pauseTransitionAtTimeOnElementWithId(
+ const CppArgumentList& args,
+ CppVariant* result) {
+ if (args.size() > 2 && args[0].isString() && args[1].isNumber() &&
+ args[2].isString()) {
+ std::string property_name = args[0].ToString();
+ double time = args[1].ToDouble();
+ std::string element_id = args[2].ToString();
+
+ webkit_glue::PauseTransitionAtTimeOnElementWithId(
+ shell_->webView(), property_name, time, element_id);
+ } else {
+ result->Set(false);
+ }
+}
+
//
// Unimplemented stubs
//