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

Unified Diff: LayoutTests/animations/resources/animation-test-helpers.js

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: LayoutTests/animations/resources/animation-test-helpers.js
diff --git a/LayoutTests/animations/resources/animation-test-helpers.js b/LayoutTests/animations/resources/animation-test-helpers.js
index 1a97ad8cae82e8b25fc49da42fe751dc4d3a7f1a..81f841e382ccb9cf4e0185b85cede7318b7cc066 100644
--- a/LayoutTests/animations/resources/animation-test-helpers.js
+++ b/LayoutTests/animations/resources/animation-test-helpers.js
@@ -18,7 +18,7 @@ Function parameters:
- the tolerance to use when comparing the effective CSS property value with its expected value
[1] If null is passed, a regular setTimeout() will be used instead to snapshot the animated property in the future,
- instead of fast forwarding using the pauseAnimationAtTimeOnElement() JS API from Internals.
+ instead of fast forwarding using the pauseAnimations() JS API from Internals.
Steve Block 2013/05/06 01:49:06 It looks like the animation name is still used to
dstockwell 2013/05/06 04:01:00 Not passing a name no longer falls back to the set
[2] If a single string is passed, it is the id of the element to test. If an array with 2 elements is passed they
are the ids of 2 elements, whose values are compared for equality. In this case the expected value is ignored
@@ -240,15 +240,8 @@ function checkExpectedValue(expected, index)
}
}
- if (animationName && hasPauseAnimationAPI && !internals.pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId))) {
- result += "FAIL - animation \"" + animationName + "\" is not running" + "<br>";
- return;
- }
-
- if (compareElements && !element2Static && animationName && hasPauseAnimationAPI && !internals.pauseAnimationAtTimeOnElement(animationName, time, document.getElementById(elementId2))) {
- result += "FAIL - animation \"" + animationName + "\" is not running" + "<br>";
- return;
- }
+ if (animationName && hasPauseAnimationAPI)
+ internals.pauseAnimations(time);
var computedValue, computedValue2;
if (compareElements) {
@@ -386,12 +379,9 @@ function startTest(expected, callback)
var maxTime = 0;
for (var i = 0; i < expected.length; ++i) {
- var animationName = expected[i][0];
var time = expected[i][1];
- // We can only use the animation fast-forward mechanism if there's an animation name
- // and Internals implements pauseAnimationAtTimeOnElement()
- if (animationName && hasPauseAnimationAPI)
+ if (hasPauseAnimationAPI)
checkExpectedValue(expected, i);
else {
if (time > maxTime)

Powered by Google App Engine
This is Rietveld 408576698