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

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/begin-use-counters.html

Issue 2132323002: Add some additional SMIL use counters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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: 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..e07265d2765aa5bd7abcc3ac964626409806dd53
--- /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 SVGSMILBeginOrEndEventValue = 1455;
+var SVGSMILBeginOrEndSyncbaseValue = 1456;
+
+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, SVGSMILBeginOrEndEventValue));
+ assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
+}, 'begin using time is not counted as event or syncbase value.');
+
+test(() => {
+ var target = document.getElementById('target');
+ assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndEventValue));
+ var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate");
+ animation.setAttribute("begin", "target.click");
+ target.appendChild(animation);
+ assert_true(internals.isUseCounted(document, SVGSMILBeginOrEndEventValue));
+}, 'begin using event-value is use counted.');
+
+test(() => {
+ var target = document.getElementById('target');
+ assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
+ var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate");
+ animation.setAttribute("begin", "anim.end");
+ target.appendChild(animation);
+ assert_true(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
+}, 'begin using syncbase-value is use counted.');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698