diff options
author | mihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 16:32:10 +0000 |
---|---|---|
committer | mihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 16:32:10 +0000 |
commit | e1ddd8c46f262419b0f217efe22ab589d85a6f56 (patch) | |
tree | 70c162ab5bd86ee764de6cd96bf7f9a1b0d0dbc7 /webkit/tools | |
parent | f6219fb2488daaa76d10a1e09bcc49785881a34a (diff) | |
download | chromium_src-e1ddd8c46f262419b0f217efe22ab589d85a6f56.zip chromium_src-e1ddd8c46f262419b0f217efe22ab589d85a6f56.tar.gz chromium_src-e1ddd8c46f262419b0f217efe22ab589d85a6f56.tar.bz2 |
Add suspend/resumeAnimations to the test_shell LayoutTestController
implementation (introduced with http://trac.webkit.org/changeset/65107)
TEST=animations/suspend-resume-animation.html
BUG=51757
Review URL: http://codereview.chromium.org/3348004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 31 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 2 |
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, |