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

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

Issue 1177303004: Updated SVGListPropertyHelper as per SVG2 Spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed presubmit error Created 5 years, 6 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: LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml
diff --git a/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml b/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml
index 80640e8a42127d56c0281ea84888b9dcd09bebf7..8aba02f492457b7e3b44083da01c75e771263c07 100644
--- a/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml
+++ b/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml
@@ -5,125 +5,39 @@
</head>
<body>
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
- <text id="text1" x="500 50 100 900 1000" y="50">ABC</text>
- <text id="text2" x="50 100 1000" y="100">ABC</text>
- <text id="reference" x="50 100 150" y="150">ABC</text>
+ <text id="text" x="500 50 100 900 150" y="50">ABC</text>
+ <text id="reference" x="50 100 150" y="100">ABC</text>
</svg>
<p id="description"></p>
<div id="console"></div>
<script type="text/javascript">
<![CDATA[
- description("This is a test of the SVGLengthList::appendItem() API.");
+ description("This is a test of the SVGLengthList::removeItem() API.");
var svg = document.getElementById("svg");
- var text1 = document.getElementById("text1");
- var text2 = document.getElementById("text2");
-
- debug("");
- debug("Create a new SVGLength object, with value=150");
- var newLength1 = svg.createSVGLength();
- newLength1.value = 150;
- shouldBe("newLength1.value", "150");
-
+ var text = document.getElementById("text");
+
debug("");
debug("Check initial list state of text1");
- shouldBe("text1.x.baseVal.numberOfItems", "5");
- shouldBe("text1.x.baseVal.getItem(0).value", "500");
- shouldBe("text1.x.baseVal.getItem(1).value", "50");
- shouldBe("text1.x.baseVal.getItem(2).value", "100");
- shouldBe("text1.x.baseVal.getItem(3).value", "900");
- shouldBe("text1.x.baseVal.getItem(4).value", "1000");
- shouldThrow("text1.x.baseVal.getItem(5)");
-
- debug("");
- debug("Check initial list state of text2");
- shouldBe("text2.x.baseVal.numberOfItems", "3");
- shouldBe("text2.x.baseVal.getItem(0).value", "50");
- shouldBe("text2.x.baseVal.getItem(1).value", "100");
- shouldBe("text2.x.baseVal.getItem(2).value", "1000");
- shouldThrow("text2.x.baseVal.getItem(3)");
-
- debug("");
- debug("Append fourth item x=900 to the text1 x list");
- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3))", "text1.x.baseVal.getItem(4)");
- shouldBe("text1.x.baseVal.numberOfItems", "5");
- shouldBe("text1.x.baseVal.getItem(0).value", "500");
- shouldBe("text1.x.baseVal.getItem(1).value", "50");
- shouldBe("text1.x.baseVal.getItem(2).value", "100");
- shouldBe("text1.x.baseVal.getItem(3).value", "1000");
- shouldBe("text1.x.baseVal.getItem(4).value", "900");
- shouldThrow("text1.x.baseVal.getItem(5)");
+ shouldBe("text.x.baseVal.numberOfItems", "5");
+ shouldBe("text.x.baseVal.getItem(0).value", "500");
+ shouldBe("text.x.baseVal.getItem(1).value", "50");
+ shouldBe("text.x.baseVal.getItem(2).value", "100");
+ shouldBe("text.x.baseVal.getItem(3).value", "900");
+ shouldBe("text.x.baseVal.getItem(4).value", "150");
+ shouldThrow("text.x.baseVal.getItem(5)");
debug("");
- debug("Append first item x=500 to the text1 x list");
- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0))", "text1.x.baseVal.getItem(4)");
- shouldBe("text1.x.baseVal.numberOfItems", "5");
- shouldBe("text1.x.baseVal.getItem(0).value", "50");
- shouldBe("text1.x.baseVal.getItem(1).value", "100");
- shouldBe("text1.x.baseVal.getItem(2).value", "1000");
- shouldBe("text1.x.baseVal.getItem(3).value", "900");
- shouldBe("text1.x.baseVal.getItem(4).value", "500");
- shouldThrow("text1.x.baseVal.getItem(5)");
-
- debug("");
- debug("Append 'newLength1' to the text1 x list");
- shouldBe("text1.x.baseVal.appendItem(newLength1)", "text1.x.baseVal.getItem(5)");
- shouldBe("text1.x.baseVal.numberOfItems", "6");
- shouldBe("text1.x.baseVal.getItem(0).value", "50");
- shouldBe("text1.x.baseVal.getItem(1).value", "100");
- shouldBe("text1.x.baseVal.getItem(2).value", "1000");
- shouldBe("text1.x.baseVal.getItem(3).value", "900");
- shouldBe("text1.x.baseVal.getItem(4).value", "500");
- shouldBe("text1.x.baseVal.getItem(5).value", "150");
- shouldThrow("text1.x.baseVal.getItem(6)");
-
- debug("");
- debug("Append third and fourth item of the text1 x list to the text2 x list");
- shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "1000");
- shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "900");
- shouldBe("text1.x.baseVal.numberOfItems", "4");
- shouldBe("text1.x.baseVal.getItem(0).value", "50");
- shouldBe("text1.x.baseVal.getItem(1).value", "100");
- shouldBe("text1.x.baseVal.getItem(2).value", "500");
- shouldBe("text1.x.baseVal.getItem(3).value", "150");
- shouldThrow("text1.x.baseVal.getItem(4)");
- shouldBe("text2.x.baseVal.numberOfItems", "5");
- shouldBe("text2.x.baseVal.getItem(0).value", "50");
- shouldBe("text2.x.baseVal.getItem(1).value", "100");
- shouldBe("text2.x.baseVal.getItem(2).value", "1000");
- shouldBe("text2.x.baseVal.getItem(3).value", "1000");
- shouldBe("text2.x.baseVal.getItem(4).value", "900");
- shouldThrow("text2.x.baseVal.getItem(5)");
-
- var newLength2 = svg.createSVGLength();
- newLength2.value = 150;
- shouldBe("newLength2.value", "150");
-
+ debug("Remove fourth item of text1");
+ shouldBe("text.x.baseVal.removeItem(0).value", "500");
+
debug("");
- debug("Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists");
- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "500");
- shouldBe("text2.x.baseVal.appendItem(newLength2).value", "150");
- shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000");
- shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value", "900");
- shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000");
- shouldBe("text1.x.baseVal.numberOfItems", "4");
- shouldBe("text1.x.baseVal.getItem(0).value", "50");
- shouldBe("text1.x.baseVal.getItem(1).value", "100");
- shouldBe("text1.x.baseVal.getItem(2).value", "150");
- shouldBe("text1.x.baseVal.getItem(3).value", "500");
- shouldThrow("text1.x.baseVal.getItem(4)");
- shouldBe("text2.x.baseVal.numberOfItems", "6");
- shouldBe("text2.x.baseVal.getItem(0).value", "50");
- shouldBe("text2.x.baseVal.getItem(1).value", "100");
- shouldBe("text2.x.baseVal.getItem(2).value", "150");
- shouldBe("text2.x.baseVal.getItem(3).value", "1000");
- shouldBe("text2.x.baseVal.getItem(4).value", "900");
- shouldBe("text2.x.baseVal.getItem(5).value", "1000");
- shouldThrow("text2.x.baseVal.getItem(6)");
+ debug("Remove third item of text1");
+ shouldBe("text.x.baseVal.removeItem(2).value", "900");
debug("");
- debug("The test passes if you only see 'PASS' messages, and all three text elements on top look the same");
+ debug("The test passes if you only see 'PASS' messages, and both text elements on top look the same");
debug("");
]]>

Powered by Google App Engine
This is Rietveld 408576698