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
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 @@
   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::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 @@
                                            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,