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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-appendItemFromClearedList.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-appendItemFromClearedList.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-appendItemFromClearedList.html b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-appendItemFromClearedList.html
index 679b21d63dff9f46ddb0e70a8cbff2ba4fa47b2b..2e23d7c56c3fd2ec1f457bd5ea4372991af43a6e 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-appendItemFromClearedList.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-appendItemFromClearedList.html
@@ -1,36 +1,30 @@
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+<!DOCTYPE HTML>
+<title>SVGLengthList, appendItem() from cleared list</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg width="200" height="200">
<text id="text1" x="1 2 3">ABC</text>
<text id="text2" x="10 20">ABC</text>
</svg>
-
<script>
- description("This is a test of the SVGLengthList::appendItem() API.");
-
- var list1 = document.getElementById("text1").x.baseVal;
- var list2 = document.getElementById("text2").x.baseVal;
-
- var itemFromClearedList = list2.getItem(0);
- list2.clear();
- shouldBe("list2.numberOfItems", "0");
+test(function() {
+ // This is a test of the SVGLengthList::appendItem() API.
- list1.appendItem(itemFromClearedList);
-
- shouldBe("list1.numberOfItems", "4");
- shouldBe("list1.getItem(0).value", "1");
- shouldBe("list1.getItem(1).value", "2");
- shouldBe("list1.getItem(2).value", "3");
- shouldBe("list1.getItem(3).value", "10");
+ var list1 = document.getElementById("text1").x.baseVal;
+ var list2 = document.getElementById("text2").x.baseVal;
- shouldBe("list2.numberOfItems", "0");
+ var itemFromClearedList = list2.getItem(0);
+ list2.clear();
+ assert_equals(list2.numberOfItems, 0);
- debug("The test passes if you only see 'PASS' messages, and test doesn't crash");
+ list1.appendItem(itemFromClearedList);
+
+ assert_equals(list1.numberOfItems, 4);
+ assert_equals(list1.getItem(0).value, 1);
+ assert_equals(list1.getItem(1).value, 2);
+ assert_equals(list1.getItem(2).value, 3);
+ assert_equals(list1.getItem(3).value, 10);
- gc();
-</script>
-</body>
-</html>
+ assert_equals(list2.numberOfItems, 0);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698