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

Unified Diff: LayoutTests/svg/dom/SVGLengthList-basics.xhtml

Issue 12288020: Merge 142759 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | LayoutTests/svg/dom/SVGLengthList-basics-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/dom/SVGLengthList-basics.xhtml
===================================================================
--- LayoutTests/svg/dom/SVGLengthList-basics.xhtml (revision 143078)
+++ LayoutTests/svg/dom/SVGLengthList-basics.xhtml (working copy)
@@ -14,6 +14,9 @@
<![CDATA[
description("This is a test of the simple SVGLengthList API parts.");
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
var text1 = document.getElementById("text1");
// Spec: The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated.
@@ -82,6 +85,19 @@
debug("");
debug("Set x='1 2 3 4' for text1");
shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
+
+ debug("");
+ debug("Test edge cases for insertItemBefore()");
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(3)");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 3 4 2");
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)");
+ shouldBeEqualToString("text1.getAttribute('x')", "3 1 4 2");
+
+ debug("");
+ debug("Set x='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
shouldBe("text1.x.baseVal.numberOfItems", "4");
shouldBe("text1.x.baseVal.getItem(0).value", "1");
shouldBe("text1.x.baseVal.getItem(1).value", "2");
@@ -101,27 +117,40 @@
shouldThrow("text1.x.baseVal.replaceItem(null, 0)");
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0)", "text1.x.baseVal.getItem(0)");
- shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.numberOfItems", "4");
shouldBe("text1.x.baseVal.getItem(0).value", "1");
- shouldBe("text1.x.baseVal.getItem(1).value", "3");
- shouldBe("text1.x.baseVal.getItem(2).value", "4");
- shouldBeEqualToString("text1.getAttribute('x')", "1 3 4");
+ shouldBe("text1.x.baseVal.getItem(1).value", "2");
+ shouldBe("text1.x.baseVal.getItem(2).value", "3");
+ shouldBe("text1.x.baseVal.getItem(3).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 'aString')", "text1.x.baseVal.getItem(0)");
- shouldBe("text1.x.baseVal.numberOfItems", "2");
+ shouldBe("text1.x.baseVal.numberOfItems", "4");
shouldBe("text1.x.baseVal.getItem(0).value", "1");
- shouldBe("text1.x.baseVal.getItem(1).value", "4");
- shouldBeEqualToString("text1.getAttribute('x')", "1 4");
+ shouldBe("text1.x.baseVal.getItem(1).value", "2");
+ shouldBe("text1.x.baseVal.getItem(2).value", "3");
+ shouldBe("text1.x.baseVal.getItem(3).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), text1)", "text1.x.baseVal.getItem(0)");
- shouldBe("text1.x.baseVal.numberOfItems", "1");
- shouldBeEqualToString("text1.getAttribute('x')", "1");
+ shouldBe("text1.x.baseVal.numberOfItems", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
- shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), null)");
- shouldBe("text1.x.baseVal.numberOfItems", "0");
- shouldBeEqualToString("text1.getAttribute('x')", "");
+ debug("");
+ debug("Set x='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
debug("");
+ debug("Test edge cases for replaceItem()");
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)");
+ shouldBe("text1.x.baseVal.numberOfItems", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text1.x.baseVal.getItem(2)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 3 2");
+ shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4)");
+
+ debug("");
debug("Set x='1 2 3 4' for text1");
shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
« no previous file with comments | « no previous file | LayoutTests/svg/dom/SVGLengthList-basics-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698