Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html |
| index 347f9b4913c3f3757767d8633a85640ec993f707..747f4bd15d1676678728f0a9a7594b4270a742c7 100644 |
| --- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html |
| +++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html |
| @@ -1,11 +1,40 @@ |
| -<!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/SVGAnimatedEnumeration-SVGClipPathElement.js"></script> |
| -</body> |
| -</html> |
| +<!DOCTYPE HTML> |
| +<title>Use of SVGAnimatedEnumeration within SVGClipPathElement</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| +test(function() { |
| + // This test checks the use of SVGAnimatedEnumeration within SVGClipPathElement. |
| + |
| + var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"); |
| + clipPathElement.setAttribute("clipPathUnits", "userSpaceOnUse"); |
| + |
| + // Check initial 'clipPathUnits' value. |
| + assert_equals(clipPathElement.clipPathUnits.toString(), "[object SVGAnimatedEnumeration]"); |
|
Srirama
2016/10/04 09:32:04
please try same thing here, to remove toString con
Shanmuga Pandi
2016/10/05 06:53:10
Done.
|
| + assert_equals(typeof(clipPathElement.clipPathUnits.baseVal), "number"); |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE); |
| + |
| + // Switch to 'objectBoundingBox'. |
| + clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); |
| + assert_equals(clipPathElement.getAttribute('clipPathUnits'), "objectBoundingBox"); |
| + |
| + // Try setting invalid values. |
| + assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = 3; }); |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); |
| + assert_equals(clipPathElement.getAttribute('clipPathUnits'), "objectBoundingBox"); |
| + |
| + assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = -1; }); |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); |
| + assert_equals(clipPathElement.getAttribute('clipPathUnits'), "objectBoundingBox"); |
| + |
| + assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = 0; }); |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX); |
| + assert_equals(clipPathElement.getAttribute('clipPathUnits'), "objectBoundingBox"); |
| + |
| + // Switch to 'userSpaceOnUse'. |
| + clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE; |
| + assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE); |
| + assert_equals(clipPathElement.getAttribute('clipPathUnits'), "userSpaceOnUse"); |
| +}); |
| +</script> |