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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.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
Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
index 87df28582c0157a4fc60ac3932bd3b69c99af21d..bbae63a1389c603fc223852b090a15d6ab21841e 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
@@ -1,11 +1,45 @@
-<!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-SVGFEConvolveMatrixElement.js"></script>
-</body>
-</html>
+<!DOCTYPE HTML>
+<title>Use of SVGAnimatedEnumeration within SVGFEConvolveMatrixElement</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // This test checks the use of SVGAnimatedEnumeration within SVGFEConvolveMatrixElement.
+
+ var feConvolveMatrixElement = document.createElementNS("http://www.w3.org/2000/svg", "feConvolveMatrix");
+ feConvolveMatrixElement.setAttribute("edgeMode", "duplicate");
+
+ // Check initial 'edgeMode' value.
+ assert_true(feConvolveMatrixElement.edgeMode instanceof SVGAnimatedEnumeration);
+ assert_equals(typeof(feConvolveMatrixElement.edgeMode.baseVal), "number");
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_DUPLICATE);
+
+ // Switch to 'wrap'.
+ feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.SVG_EDGEMODE_WRAP;
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_WRAP);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "wrap");
+
+ // Switch to 'none'.
+ feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE;
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "none");
+
+ // Try setting invalid values.
+ assert_throws(new TypeError(), function() { feConvolveMatrixElement.edgeMode.baseVal = 4; });
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "none");
+
+ assert_throws(new TypeError(), function() { feConvolveMatrixElement.edgeMode.baseVal = -1; });
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "none");
+
+ assert_throws(new TypeError(), function() { feConvolveMatrixElement.edgeMode.baseVal = 0; });
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "none");
+
+ // Switch to 'duplicate'.
+ feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.SVG_EDGEMODE_DUPLICATE;
+ assert_equals(feConvolveMatrixElement.edgeMode.baseVal, SVGFEConvolveMatrixElement.SVG_EDGEMODE_DUPLICATE);
+ assert_equals(feConvolveMatrixElement.getAttribute('edgeMode'), "duplicate");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698