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

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

Issue 2705293005: Convert LayoutTests/svg/dom/SVGAnimated*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Align with review comments 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
Index: third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedBoolean.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedBoolean.html b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedBoolean.html
index 179b16e1251c00006f5be4da928c6fe707741c4c..657156482a501348acf12b07a662cdd8c85d3fef 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedBoolean.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGAnimatedBoolean.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/SVGAnimatedBoolean.js"></script>
-</body>
-</html>
+<!DOCTYPE HTML>
+<title>SVGAnimatedBoolean interface - utilizing the preserveAlpha property of SVGFEConvolveMatrixElement</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ // This test checks the SVGAnimatedBoolean API - utilizing the preserveAlpha property of SVGFEConvolveMatrixElement.
+
+ var convElement = document.createElementNS("http://www.w3.org/2000/svg", "feConvolveMatrix");
+ // Check initial preserveAlpha value.
+ assert_false(convElement.preserveAlpha.baseVal);
+
+ // Set value to true.
+ convElement.preserveAlpha.baseVal = true;
+ assert_true(convElement.preserveAlpha.baseVal);
+
+ // Caching baseVal in local variable.
+ var baseVal = convElement.preserveAlpha.baseVal;
+ assert_true(baseVal);
+
+ // Modify local baseVal variable to false.
+ baseVal = false;
+
+ // Assure that convElement.preserveAlpha has not been changed, but the local baseVal variable.
+ assert_false(baseVal);
+ assert_true(convElement.preserveAlpha.baseVal);
+
+ // Check assigning values of various types.
+ // ECMA-262, 9.2, "ToBoolean"
+ convElement.preserveAlpha.baseVal = convElement.preserveAlpha;
+ assert_true(convElement.preserveAlpha.baseVal);
+
+ convElement.preserveAlpha.baseVal = null;
+ assert_false(convElement.preserveAlpha.baseVal);
+
+ convElement.preserveAlpha.baseVal = 'aString';
+ assert_true(convElement.preserveAlpha.baseVal);
+
+ convElement.preserveAlpha.baseVal = false;
+ assert_false(convElement.preserveAlpha.baseVal);
+
+ convElement.preserveAlpha.baseVal = convElement;
+ assert_true(convElement.preserveAlpha.baseVal);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698