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

Unified Diff: Source/core/testing/Internals.cpp

Issue 14556022: Simplify animation testing API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 7 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 | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index ed201b201c7949440beb60824c1e6024525c6042..5cb56d045ca7f7d1522276f3fe020bf31e6befda 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -435,66 +435,14 @@ void Internals::resumeAnimations(Document* document, ExceptionCode& ec) const
controller->resumeAnimations();
}
-bool Internals::pauseAnimationAtTimeOnElement(const String& animationName, double pauseTime, Element* element, ExceptionCode& ec)
+void Internals::pauseAnimations(double pauseTime, ExceptionCode& ec)
{
- if (!element || pauseTime < 0) {
+ if (pauseTime < 0) {
ec = INVALID_ACCESS_ERR;
- return false;
- }
- AnimationController* controller = frame()->animation();
- return controller->pauseAnimationAtTime(element->renderer(), AtomicString(animationName), pauseTime);
-}
-
-bool Internals::pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element* element, const String& pseudoId, ExceptionCode& ec)
-{
- if (!element || pauseTime < 0) {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
-
- if (pseudoId != "before" && pseudoId != "after") {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
-
- PseudoElement* pseudoElement = element->pseudoElement(pseudoId == "before" ? BEFORE : AFTER);
- if (!pseudoElement) {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
-
- return frame()->animation()->pauseAnimationAtTime(pseudoElement->renderer(), AtomicString(animationName), pauseTime);
-}
-
-bool Internals::pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element* element, ExceptionCode& ec)
-{
- if (!element || pauseTime < 0) {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
- AnimationController* controller = frame()->animation();
- return controller->pauseTransitionAtTime(element->renderer(), propertyName, pauseTime);
-}
-
-bool Internals::pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element* element, const String& pseudoId, ExceptionCode& ec)
-{
- if (!element || pauseTime < 0) {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
-
- if (pseudoId != "before" && pseudoId != "after") {
- ec = INVALID_ACCESS_ERR;
- return false;
- }
-
- PseudoElement* pseudoElement = element->pseudoElement(pseudoId == "before" ? BEFORE : AFTER);
- if (!pseudoElement) {
- ec = INVALID_ACCESS_ERR;
- return false;
+ return;
}
- return frame()->animation()->pauseTransitionAtTime(pseudoElement->renderer(), property, pauseTime);
+ frame()->animation()->pauseAnimationsForTesting(pauseTime);
}
bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionCode& ec) const
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698