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

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

Issue 14556022: Simplify animation testing API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add new tests. Created 7 years, 8 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
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index eaf3613f436be187734886d573ff0d0319511098..027ace5bb444b1cdc1485e163878539ca5593f86 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -428,66 +428,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

Powered by Google App Engine
This is Rietveld 408576698