Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 3348004: Add suspend/resumeAnimations to the test_shell LayoutTestController... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/layout_test_controller.cc
===================================================================
--- webkit/tools/test_shell/layout_test_controller.cc (revision 57932)
+++ webkit/tools/test_shell/layout_test_controller.cc (working copy)
@@ -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);
@@ -829,6 +832,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) {
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698