summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc31
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index e250886..9ec3dfb 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -15,6 +15,7 @@
#include "base/path_service.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebAnimationController.h"
#include "third_party/WebKit/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
@@ -129,6 +130,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
BindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
BindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
+ BindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ BindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
BindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
BindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
BindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
@@ -835,6 +838,34 @@ void LayoutTestController::pauseTransitionAtTimeOnElementWithId(
}
}
+void LayoutTestController::suspendAnimations(
+ const CppArgumentList& args, CppVariant* result) {
+ result->SetNull();
+
+ WebKit::WebFrame* web_frame = shell_->webView()->mainFrame();
+ if (!web_frame)
+ return;
+
+ WebKit::WebAnimationController* controller = web_frame->animationController();
+ if (!controller)
+ return;
+ controller->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations(
+ const CppArgumentList& args, CppVariant* result) {
+ result->SetNull();
+
+ WebKit::WebFrame* web_frame = shell_->webView()->mainFrame();
+ if (!web_frame)
+ return;
+
+ WebKit::WebAnimationController* controller = web_frame->animationController();
+ if (!controller)
+ return;
+ controller->resumeAnimations();
+}
+
void LayoutTestController::elementDoesAutoCompleteForElementWithId(
const CppArgumentList& args,
CppVariant* result) {
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index d048d0f..97e53bd 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -181,6 +181,8 @@ class LayoutTestController : public CppBoundClass {
CppVariant* result);
void pauseTransitionAtTimeOnElementWithId(const CppArgumentList& args,
CppVariant* result);
+ void suspendAnimations(const CppArgumentList& args, CppVariant* result);
+ void resumeAnimations(const CppArgumentList& args, CppVariant* result);
void elementDoesAutoCompleteForElementWithId(const CppArgumentList& args,
CppVariant* result);
void numberOfActiveAnimations(const CppArgumentList& args,