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

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

Issue 2344403002: 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-setEmptyString.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-setEmptyString.html b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-setEmptyString.html
index f808d36638bbc14aed1ec5da6b44011a10e999b1..78f579bbb1a146d1cb820801029351b2613c4567 100644
--- a/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-setEmptyString.html
+++ b/third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-setEmptyString.html
@@ -1,20 +1,22 @@
<!DOCTYPE HTML>
-<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+<title>SVGLengthList, set empty string</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg width="200" height="200">
<text></text>
</svg>
-<script src="../../resources/js-test.js"></script>
<script>
-if (window.testRunner)
- testRunner.dumpAsText();
+test(function() {
+ var text = document.querySelector('text');
+ var list = text.x.baseVal;
+ text.setAttribute("x", "1 2 3");
+ assert_equals(list.numberOfItems, 3);
+ text.setAttribute("x", "");
+ assert_equals(list.numberOfItems, 0);
-var text = document.querySelector('text');
-text.setAttribute("x", "1 2 3");
-shouldBe("text.x.baseVal.numberOfItems", "3");
-text.setAttribute("x", "");
-shouldBe("text.x.baseVal.numberOfItems", "0");
-
-text.setAttribute("x", "1 2 3");
-shouldBe("text.x.baseVal.numberOfItems", "3");
-text.removeAttribute("x");
-shouldBe("text.x.baseVal.numberOfItems", "0");
-</script>
+ text.setAttribute("x", "1 2 3");
+ assert_equals(list.numberOfItems, 3);
+ text.removeAttribute("x");
+ assert_equals(list.numberOfItems, 0);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698