Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedInteger.html |
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedInteger.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedInteger.html |
index 88fdda8c5b5ec298f6468d65c7ec7582b84dc325..8a12a99668f81ced0859f0eaca1e5f65e5ac511e 100644 |
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedInteger.html |
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedInteger.html |
@@ -1,11 +1,35 @@ |
-<!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/SVGAnimatedInteger.js"></script> |
-</body> |
-</html> |
+<!DOCTYPE HTML> |
+<title>SVGAnimatedInteger interface - utilizing the targetX property of SVGFEConvolveMatrix</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+test(function() { |
+ // This test checks the SVGAnimatedInteger API - utilizing the targetX property of SVGFEConvolveMatrix. |
+ |
+ var feConvolveMatrix = document.createElementNS("http://www.w3.org/2000/svg", "feConvolveMatrix"); |
+ |
+ // Check initial targetX value. |
+ assert_true(feConvolveMatrix.targetX instanceof SVGAnimatedInteger); |
+ assert_equals(typeof(feConvolveMatrix.targetX.baseVal), "number"); |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 0); |
+ |
+ // Check that integers are static, caching value in a local variable and modifying it, should have no effect. |
+ var numRef = feConvolveMatrix.targetX.baseVal; |
+ numRef = 100; |
+ assert_equals(numRef, 100); |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 0); |
+ |
+ // Check assigning various valid and invalid values. |
+ feConvolveMatrix.targetX.baseVal = -1; |
+ assert_equals(feConvolveMatrix.targetX.baseVal, -1); // Negative values are allowed from SVG DOM, but should lead to an error when rendering (disable the filter) |
+ feConvolveMatrix.targetX.baseVal = 300; |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 300); |
+ // ECMA-262, 9.5, "ToInt32" |
+ feConvolveMatrix.targetX.baseVal = 'aString'; |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 0); |
+ feConvolveMatrix.targetX.baseVal = feConvolveMatrix; |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 0); |
+ feConvolveMatrix.targetX.baseVal = 300; |
+ assert_equals(feConvolveMatrix.targetX.baseVal, 300); |
+}); |
+</script> |