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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedNumberList.html

Issue 2713833002: Convert LayoutTests/svg/dom/SVGAnimated*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Created 3 years, 10 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/dom/SVGAnimatedNumberList.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedNumberList.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedNumberList.html
index dd42e3cf0601be79e1a9a0177d6daf5bade6016b..3aa30e40aa47c753d3ab511a78cab17f3591100d 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedNumberList.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedNumberList.html
@@ -1,11 +1,34 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/SVGAnimatedNumberList.js"></script>
-</body>
-</html>
+<!DOCTYPE HTML>
+<title>SVGAnimatedNumberList interface - utilizing the rotate property of SVGTextElement</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // This test checks the SVGAnimatedNumberList API - utilizing the rotate property of SVGTextElement.
+
+ var textElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
+ textElement.setAttribute("rotate", "50");
+
+ // Check initial rotate value.
+ assert_true(textElement.rotate instanceof SVGAnimatedNumberList);
+ assert_true(textElement.rotate.baseVal instanceof SVGNumberList);
+ assert_equals(textElement.rotate.baseVal.getItem(0).value, 50);
+
+ // Check that number lists are dynamic, caching value in a local variable and modifying it, should take effect.
+ var numRef = textElement.rotate.baseVal;
+ numRef.getItem(0).value = 100;
+ assert_equals(numRef.getItem(0).value, 100);
+ assert_equals(textElement.rotate.baseVal.getItem(0).value, 100);
+
+ // Check that assigning to baseVal has no effect, as no setter is defined.
+ textElement.rotate.baseVal = -1;
+ assert_equals(textElement.rotate.baseVal.getItem(0).value, 100);
+ textElement.rotate.baseVal = 'aString';
+ assert_equals(textElement.rotate.baseVal.getItem(0).value, 100);
+ textElement.rotate.baseVal = textElement;
+ assert_equals(textElement.rotate.baseVal.getItem(0).value, 100);
+
+ // Check that the rotate baseVal type has not been changed.
+ assert_true(textElement.rotate.baseVal instanceof SVGNumberList);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698