Chromium Code Reviews| Index: LayoutTests/svg/animations/animate-restart-never.html |
| diff --git a/LayoutTests/svg/animations/animate-restart-never.html b/LayoutTests/svg/animations/animate-restart-never.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..43ec4602b1914d05ca3a769836b1cb5945fa966c |
| --- /dev/null |
| +++ b/LayoutTests/svg/animations/animate-restart-never.html |
| @@ -0,0 +1,66 @@ |
| +<!DOCTYPE html> |
| +<head> |
| +<script src="resources/SVGTestCase.js"></script> |
| +<script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
|
fs
2015/04/30 13:24:43
This test looks really complicated, and why is it
Shanmuga Pandi
2015/04/30 13:42:57
Ok. I will check for reducing the complexity.
Shanmuga Pandi
2015/05/04 13:06:28
Changed logic !!
|
| +<script> |
| +window.testIsAsync = true; |
| + |
| +function finishTest() { |
| + finishRepaintTest(); |
| +} |
| + |
| +function click(x,y) { |
| + if (window.eventSender) { |
| + eventSender.mouseMoveTo(x, y); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + } |
| +} |
| + |
| +function repaintTest() |
| +{ |
| + var rect = document.getElementById('rect'); |
| + var anim = document.getElementById('anim'); |
| + var actions = [ |
| + function() { |
| + click(50,50); |
| + }, |
| + function() { |
| + rect.setAttribute("fill", "green"); |
| + anim.setAttribute("from", "green"); |
| + anim.setAttribute("to", "red"); |
| + anim.setAttribute("fill", "freeze"); |
| + }, |
| + function() { |
| + click(50,50); |
| + }, |
| + function() { |
| + finishTest(); |
| + }, |
| + ]; |
| + |
| + function nextAction() { |
| + var f = actions.shift(); |
| + if (!f) |
| + return; |
| + f(); |
| + setTimeout(nextAction,50); |
| + } |
| + nextAction(); |
| +} |
| +</script> |
| +</head> |
| +<body onload="runRepaintAndPixelTest()"> |
| +<svg height="200" width="200"> |
| + <rect id="rect" width="100px" height="100px" fill="red"/> |
| + <animate id="anim" xlink:href="#rect" |
| + begin="rect.click" |
| + dur="0.01s" |
| + attributeType="xml" |
| + attributeName="fill" |
| + from="green" to="red" |
| + repeatCount="1" |
| + restart="never"/> |
| +</svg> |
| +</body> |
| +</html> |