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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.html
index 54ae2e9bbde8b6e2c671203b5f9e7b7ba5cb07d7..f5388a874cd4b4cffc5b355256a67840d02a813f 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength.html
@@ -1,11 +1,33 @@
-<!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/SVGAnimatedLength.js"></script>
-</body>
-</html>
+<!DOCTYPE HTML>
+<title>SVGAnimatedLength interface - utilizing the width property of SVGRectElement</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // This test checks the SVGAnimatedLength API - utilizing the width property of SVGRectElement.
+
+ var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+
+ // Check initial width value.
+ assert_true(rectElement.width instanceof SVGAnimatedLength);
+ assert_true(rectElement.width.baseVal instanceof SVGLength);
+ assert_equals(rectElement.width.baseVal.value, 0);
+
+ // Check that lengths are dynamic, caching value in a local variable and modifying it, should take effect.
+ var numRef = rectElement.width.baseVal;
+ numRef.value = 100;
+ assert_equals(numRef.value, 100);
+ assert_equals(rectElement.width.baseVal.value, 100);
+
+ // Check that assigning to baseVal has no effect, as no setter is defined.
+ rectElement.width.baseVal = -1;
+ assert_equals(rectElement.width.baseVal.value, 100);
+ rectElement.width.baseVal = 'aString';
+ assert_equals(rectElement.width.baseVal.value, 100);
+ rectElement.width.baseVal = rectElement;
+ assert_equals(rectElement.width.baseVal.value, 100);
+
+ // Check that the width baseVal type has not been changed.
+ assert_true(rectElement.width.baseVal instanceof SVGLength);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedLength-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698