diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp index e82a65e..beae21e 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -117,6 +117,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId); bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); + bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations); + bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations); bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading); bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate); @@ -838,6 +840,32 @@ int LayoutTestController::numberOfActiveAnimations() return controller->numberOfActiveAnimations(); } +void LayoutTestController::suspendAnimations() +{ + WebFrame* webFrame = m_shell->webView()->mainFrame(); + if (!webFrame) + return; + + WebAnimationController* controller = webFrame->animationController(); + if (!controller) + return; + + controller->suspendAnimations(); +} + +void LayoutTestController::resumeAnimations() +{ + WebFrame* webFrame = m_shell->webView()->mainFrame(); + if (!webFrame) + return; + + WebAnimationController* controller = webFrame->animationController(); + if (!controller) + return; + + controller->resumeAnimations(); +} + void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); @@ -875,6 +903,18 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppV result->set(numberOfActiveAnimations()); } +void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result) +{ + suspendAnimations(); + result->setNull(); +} + +void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result) +{ + resumeAnimations(); + result->setNull(); +} + void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->webView()->settings()->setLoadsImagesAutomatically(false); |