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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-getItem.html

Issue 2340733002: Convert LayoutTests/svg/dom/SVGLengthList*.html js-tests.js to testharness.js based tests (Closed)
Patch Set: Align with review comments Created 4 years, 3 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/SVGLengthList-getItem.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-getItem.html b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-getItem.html
new file mode 100644
index 0000000000000000000000000000000000000000..10a2c13f55356101ff2c9513588cf8ac47d15f81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-getItem.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<title>SVGLengthList, getItem()</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg width="200" height="200">
+ <text x="50 100 150" y="50">ABC</text>
+</svg>
+<script>
+test(function() {
+ // This is a test of the SVGLengthList::getItem() API.
+ var xList = document.querySelector("text").x.baseVal;
+
+ // Check lengths of text x item lists.
+ assert_equals(xList.numberOfItems, 3);
+
+ // Test with various index parameters.
+ assert_throws("IndexSizeError", function() { xList.getItem(-100); });
+ assert_throws("IndexSizeError", function() { xList.getItem(-1); });
+ assert_equals(xList.getItem(0).value, 50);
+ assert_equals(xList.getItem(1).value, 100);
+ assert_equals(xList.getItem(2).value, 150);
+ assert_throws("IndexSizeError", function() { xList.getItem(3); });
+ assert_throws("IndexSizeError", function() { xList.getItem(100); });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698