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

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

Issue 2389803004: Convert LayoutTests/svg/dom/SVGAnimatedEnumeration*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Align with review comments Created 4 years, 2 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/SVGAnimatedEnumeration-SVGClipPathElement.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
index c2021cbcd5e546fa8a142b02fa0c1dc9571ca210..74069547f102a2131fde3861fb456007a44129ee 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
@@ -1,11 +1,41 @@
-<!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.js"></script>
-</body>
-</html>
+<!DOCTYPE HTML>
+<title>SVGAnimatedEnumeration interface - utilizing the clipPathUnits property of SVGClipPathElement</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // This test checks the SVGAnimatedEnumeration API - utilizing the clipPathUnits property of SVGClipPathElement.
+
+ var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "clipPath");
+
+ // Check initial clipPathUnits value.
+ assert_true(clipPathElement.clipPathUnits instanceof SVGAnimatedEnumeration);
+ assert_equals(typeof(clipPathElement.clipPathUnits.baseVal), "number");
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+
+ // Check that enumerations are static, caching value in a local variable and modifying it, should have no effect.
+ var enumRef = clipPathElement.clipPathUnits.baseVal;
+ enumRef = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+ assert_equals(enumRef, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+
+ // Check assigning various valid and invalid values.
+ assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = 3; });
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+ assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = -1; });
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+
+ // ECMA-262, 9.7, "ToUint16"
+ clipPathElement.clipPathUnits.baseVal = '1';
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+
+ // ECMA-262, 9.7, "ToUint16"
+ assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = 'aString'; });
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE);
+
+ clipPathElement.clipPathUnits.baseVal = 2;
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ assert_throws(new TypeError(), function() { clipPathElement.clipPathUnits.baseVal = clipPathElement; });
+ assert_equals(clipPathElement.clipPathUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698