Index: third_party/WebKit/LayoutTests/animations/animation-direction-alternate-reverse.html |
diff --git a/third_party/WebKit/LayoutTests/animations/animation-direction-alternate-reverse.html b/third_party/WebKit/LayoutTests/animations/animation-direction-alternate-reverse.html |
index 480b5e6ac77f1bcbea1d033db1b8edf08321edaa..f66550703b948a54e98cf1462032aab91c3c4abb 100644 |
--- a/third_party/WebKit/LayoutTests/animations/animation-direction-alternate-reverse.html |
+++ b/third_party/WebKit/LayoutTests/animations/animation-direction-alternate-reverse.html |
@@ -1,62 +1,50 @@ |
<!DOCTYPE html> |
- |
-<html> |
-<head> |
- <style type="text/css" media="screen"> |
- |
- #container { |
- position: relative; |
- border: 1px solid black; |
- height: 100px; |
- width: 500px; |
- } |
- |
- #box { |
- position: absolute; |
- height: 100px; |
- width: 100px; |
- background-color: blue; |
- animation-name: move; |
- animation-duration: 2s; |
+<title>Test of animation-direction</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<style> |
+ #target { |
animation-direction: alternate-reverse; |
+ animation-duration: 2s; |
animation-iteration-count: 2; |
+ animation-name: move; |
+ animation-play-state: paused; |
animation-timing-function: linear; |
animation-fill-mode: forwards; |
- } |
+ |
+ background-color: red; |
+ height: 100px; |
+ left: 0px; |
+ position: absolute; |
+ width: 100px; |
+ } |
@keyframes move { |
- 0% { |
- left: 0; |
- } |
- 100% { |
- left: 400px; |
- } |
+ from { left: 0px; } |
+ to { left: 400px; } |
} |
- |
- </style> |
- <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script> |
- <script type="text/javascript" charset="utf-8"> |
- |
- const expectedValues = [ |
- // [time, element-id, property, expected-value, tolerance] |
- [1.0, "box", "left", 200, 20], |
- [2.0, "box", "left", 0, 20], |
- |
- [3.0, "box", "left", 200, 20], |
- [4.0, "box", "left", 400, 20], |
- ]; |
- |
- runAnimationTest(expectedValues); |
- </script> |
-</head> |
-<body> |
- |
-<!-- Test animation-direction: alternate-reverse --> |
-<div id="container"> |
- <div id="box"></div> |
-</div> |
- |
-<div id="result"></div> |
- |
-</body> |
-</html> |
+ |
+</style> |
+<div id="target"></div> |
+<script> |
+ 'use strict'; |
+ test(function() { |
+ target.style.animationDelay = '-0.5s'; |
+ assert_equals(getComputedStyle(target).left, '300px'); |
+ |
+ target.style.animationDelay = '-1s'; |
+ assert_equals(getComputedStyle(target).left, '200px'); |
+ |
+ target.style.animationDelay = '-2s'; |
+ assert_equals(getComputedStyle(target).left, '0px'); |
+ |
+ target.style.animationDelay = '-2.5s'; |
+ assert_equals(getComputedStyle(target).left, '100px'); |
+ |
+ target.style.animationDelay = '-3s'; |
+ assert_equals(getComputedStyle(target).left, '200px'); |
+ |
+ target.style.animationDelay = '-4s'; |
+ assert_equals(getComputedStyle(target).left, '400px'); |
+ }, "animation-direction alternate-reverse plays backwards, then forwards"); |
+</script> |