Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/animations/begin-use-counters.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/animations/begin-use-counters.html b/third_party/WebKit/LayoutTests/svg/animations/begin-use-counters.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4f83390d477a66dc918b33d6d70a6495cb62a70b |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/animations/begin-use-counters.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" /> |
| +</svg> |
| +<script> |
| +'use strict'; |
| + |
| +// From UseCounter.h |
| +var SVGEventValue = 1440; |
| +var SVGSyncbaseValue = 1441; |
|
Mike Lawther (Google)
2016/07/13 07:30:54
nit: consider using the same names as the enum fro
suzyh_UTC10 (ex-contributor)
2016/07/13 23:08:07
Ditto.
|
| + |
| +test(() => { |
| + var target = document.getElementById('target'); |
| + var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate"); |
| + animation.setAttribute("begin", "5s"); |
| + target.appendChild(animation); |
| + assert_false(internals.isUseCounted(document, SVGEventValue)); |
| + assert_false(internals.isUseCounted(document, SVGSyncbaseValue)); |
| +}, 'begin using time is not counted as event or syncbase value.'); |
| + |
| +test(() => { |
| + var target = document.getElementById('target'); |
| + assert_false(internals.isUseCounted(document, SVGEventValue)); |
| + var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate"); |
| + animation.setAttribute("begin", "target.click"); |
| + target.appendChild(animation); |
| + assert_true(internals.isUseCounted(document, SVGEventValue)); |
| +}, 'begin using event-value is use counted.'); |
| + |
| +test(() => { |
| + var target = document.getElementById('target'); |
| + assert_false(internals.isUseCounted(document, SVGSyncbaseValue)); |
| + var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate"); |
| + animation.setAttribute("begin", "anim.end"); |
| + target.appendChild(animation); |
| + assert_true(internals.isUseCounted(document, SVGSyncbaseValue)); |
| +}, 'begin using syncbase-value is use counted.'); |
| + |
| +</script> |