Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/animations/animation-started-use-counter.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/animations/animation-started-use-counter.html b/third_party/WebKit/LayoutTests/svg/animations/animation-started-use-counter.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1046c37db1e02a969993ad5c213db3ba1b31e389 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/animations/animation-started-use-counter.html |
| @@ -0,0 +1,41 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<svg width="400" height="400"> |
| + <rect id="target" x="10" y="10" width="80" height="80"> |
| + </rect> |
| +</svg> |
| +<script> |
| +'use strict'; |
| + |
| +// From UseCounter.h |
| +var SVGSMILAnimationAppliedEffect = 1458; |
| + |
| +var testHandle = async_test("Count when SMIL animation has rendered a frame"); |
|
fs
2016/07/21 10:17:32
Maybe s/rendered a frame/been applied/ to more clo
suzyh_UTC10 (ex-contributor)
2016/07/25 03:16:00
Done.
|
| + |
| +requestAnimationFrame(function() { |
|
fs
2016/07/21 10:17:32
Optionally I think you could pause the timeline (S
suzyh_UTC10 (ex-contributor)
2016/07/25 03:15:59
I tried the following test, but it crashed in debu
fs
2016/07/25 14:50:41
I've hard time seeing that it wouldn't be a bug. C
|
| + requestAnimationFrame(function() { |
| + testHandle.step(function() { |
| + var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate"); |
| + animation.setAttribute("attributeType", "XML"); |
| + animation.setAttribute("attributeName", "y"); |
| + animation.setAttribute("from", "210"); |
| + animation.setAttribute("to", "310"); |
| + animation.setAttribute("begin", "-5"); |
| + animation.setAttribute("dur", "20"); |
| + target.appendChild(animation); |
| + assert_false(internals.isUseCounted(document, SVGSMILAnimationAppliedEffect)); |
| + }); |
| + |
| + requestAnimationFrame(function() { |
| + requestAnimationFrame(function() { |
| + testHandle.step(function() { |
| + assert_true(internals.isUseCounted(document, SVGSMILAnimationAppliedEffect)); |
| + testHandle.done(); |
| + }); |
| + }); |
| + }); |
| + }); |
| +}); |
| + |
| +</script> |