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

Side by Side Diff: LayoutTests/svg/dom/SVGLengthList-basics.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 unified diff | Download patch
OLDNEW
1 <html xmlns="http://www.w3.org/1999/xhtml"> 1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head> 2 <head>
3 <script>window.enablePixelTesting = true;</script> 3 <script>window.enablePixelTesting = true;</script>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> 7 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
8 <text id="text1" x="500 1000 1500" y="50"> ABC </text> 8 <text id="text1" x="500 1000 1500" y="50"> ABC </text>
9 </svg> 9 </svg>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 shouldBe("text1.x.baseVal.getItem(null)", "text1.x.baseVal.getItem(0)"); 43 shouldBe("text1.x.baseVal.getItem(null)", "text1.x.baseVal.getItem(0)");
44 44
45 debug(""); 45 debug("");
46 debug("Test uncommon arguments for insertItemBefore()"); 46 debug("Test uncommon arguments for insertItemBefore()");
47 shouldThrow("text1.x.baseVal.insertItemBefore(30)"); 47 shouldThrow("text1.x.baseVal.insertItemBefore(30)");
48 shouldThrow("text1.x.baseVal.insertItemBefore('aString')"); 48 shouldThrow("text1.x.baseVal.insertItemBefore('aString')");
49 shouldThrow("text1.x.baseVal.insertItemBefore(text1)"); 49 shouldThrow("text1.x.baseVal.insertItemBefore(text1)");
50 shouldThrow("text1.x.baseVal.insertItemBefore(null)"); 50 shouldThrow("text1.x.baseVal.insertItemBefore(null)");
51 51
52 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aStr ing')", "text1.x.baseVal.getItem(0)"); 52 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aStr ing')", "text1.x.baseVal.getItem(0)");
53 shouldBe("text1.x.baseVal.numberOfItems", "3"); 53 shouldBe("text1.x.baseVal.numberOfItems", "4");
54 shouldBe("text1.x.baseVal.getItem(0).value", "1000"); 54 shouldBe("text1.x.baseVal.getItem(0).value", "1000");
55 shouldBe("text1.x.baseVal.getItem(1).value", "500"); 55 shouldBe("text1.x.baseVal.getItem(1).value", "500");
56 shouldBe("text1.x.baseVal.getItem(2).value", "1500"); 56 shouldBe("text1.x.baseVal.getItem(2).value", "1000");
57 shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500"); 57 shouldBe("text1.x.baseVal.getItem(3).value", "1500");
58 shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1000 1500");
58 59
59 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1 )", "text1.x.baseVal.getItem(0)"); 60 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1 )", "text1.x.baseVal.getItem(0)");
60 shouldBe("text1.x.baseVal.numberOfItems", "3"); 61 shouldBe("text1.x.baseVal.numberOfItems", "5");
61 shouldBe("text1.x.baseVal.getItem(0).value", "500"); 62 shouldBe("text1.x.baseVal.getItem(0).value", "500");
62 shouldBe("text1.x.baseVal.getItem(1).value", "1000"); 63 shouldBe("text1.x.baseVal.getItem(1).value", "1000");
63 shouldBe("text1.x.baseVal.getItem(2).value", "1500"); 64 shouldBe("text1.x.baseVal.getItem(2).value", "500");
64 shouldBeEqualToString("text1.getAttribute('x')", "500 1000 1500"); 65 shouldBe("text1.x.baseVal.getItem(3).value", "1000");
66 shouldBe("text1.x.baseVal.getItem(4).value", "1500");
67
68 shouldBeEqualToString("text1.getAttribute('x')", "500 1000 500 1000 1500");
65 69
66 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null) ", "text1.x.baseVal.getItem(0)"); 70 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null) ", "text1.x.baseVal.getItem(0)");
67 shouldBe("text1.x.baseVal.numberOfItems", "3"); 71 shouldBe("text1.x.baseVal.numberOfItems", "6");
68 shouldBe("text1.x.baseVal.getItem(0).value", "1000"); 72 shouldBe("text1.x.baseVal.getItem(0).value", "1000");
69 shouldBe("text1.x.baseVal.getItem(1).value", "500"); 73 shouldBe("text1.x.baseVal.getItem(1).value", "500");
70 shouldBe("text1.x.baseVal.getItem(2).value", "1500"); 74 shouldBe("text1.x.baseVal.getItem(2).value", "1000");
71 shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500"); 75 shouldBe("text1.x.baseVal.getItem(3).value", "500");
76 shouldBe("text1.x.baseVal.getItem(4).value", "1000");
77 shouldBe("text1.x.baseVal.getItem(5).value", "1500");
78 shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1000 500 1000 150 0");
72 79
73 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)"); 80 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)");
74 shouldBe("text1.x.baseVal.numberOfItems", "3"); 81 shouldBe("text1.x.baseVal.numberOfItems", "7");
75 shouldBe("text1.x.baseVal.getItem(0).value", "500"); 82 shouldBe("text1.x.baseVal.getItem(0).value", "500");
76 shouldBe("text1.x.baseVal.getItem(1).value", "1000"); 83 shouldBe("text1.x.baseVal.getItem(1).value", "1000");
77 shouldBe("text1.x.baseVal.getItem(2).value", "1500"); 84 shouldBe("text1.x.baseVal.getItem(2).value", "500");
78 shouldBeEqualToString("text1.getAttribute('x')", "500 1000 1500"); 85 shouldBe("text1.x.baseVal.getItem(3).value", "1000");
86 shouldBe("text1.x.baseVal.getItem(4).value", "500");
87 shouldBe("text1.x.baseVal.getItem(5).value", "1000");
88 shouldBe("text1.x.baseVal.getItem(6).value", "1500");
89 shouldBeEqualToString("text1.getAttribute('x')", "500 1000 500 1000 500 1000 1500");
79 90
80 shouldThrow("text1.x.baseVal.insertItemBefore(30, 0)"); 91 shouldThrow("text1.x.baseVal.insertItemBefore(30, 0)");
81 shouldThrow("text1.x.baseVal.insertItemBefore('aString', 0)"); 92 shouldThrow("text1.x.baseVal.insertItemBefore('aString', 0)");
82 shouldThrow("text1.x.baseVal.insertItemBefore(text1, 0)"); 93 shouldThrow("text1.x.baseVal.insertItemBefore(text1, 0)");
83 shouldThrow("text1.x.baseVal.insertItemBefore(null, 0)"); 94 shouldThrow("text1.x.baseVal.insertItemBefore(null, 0)");
84 95
85 debug(""); 96 debug("");
86 debug("Set x='1 2 3 4' for text1"); 97 debug("Set x='1 2 3 4' for text1");
87 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); 98 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
88 99
89 debug(""); 100 debug("");
90 debug("Test edge cases for insertItemBefore()"); 101 debug("Test edge cases for insertItemBefore()");
91 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)"); 102 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)");
92 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); 103 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4 4");
93 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(3)"); 104 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(5)");
94 shouldBeEqualToString("text1.getAttribute('x')", "1 3 4 2"); 105 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4 4 2");
95 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)"); 106 shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)");
96 shouldBeEqualToString("text1.getAttribute('x')", "3 1 4 2"); 107 shouldBeEqualToString("text1.getAttribute('x')", "2 1 2 3 4 4 2");
97 108
98 debug(""); 109 debug("");
99 debug("Set x='1 2 3 4' for text1"); 110 debug("Set x='1 2 3 4' for text1");
100 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); 111 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
101 shouldBe("text1.x.baseVal.numberOfItems", "4"); 112 shouldBe("text1.x.baseVal.numberOfItems", "4");
102 shouldBe("text1.x.baseVal.getItem(0).value", "1"); 113 shouldBe("text1.x.baseVal.getItem(0).value", "1");
103 shouldBe("text1.x.baseVal.getItem(1).value", "2"); 114 shouldBe("text1.x.baseVal.getItem(1).value", "2");
104 shouldBe("text1.x.baseVal.getItem(2).value", "3"); 115 shouldBe("text1.x.baseVal.getItem(2).value", "3");
105 shouldBe("text1.x.baseVal.getItem(3).value", "4"); 116 shouldBe("text1.x.baseVal.getItem(3).value", "4");
106 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); 117 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 156
146 debug(""); 157 debug("");
147 debug("Set x='1 2 3 4' for text1"); 158 debug("Set x='1 2 3 4' for text1");
148 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); 159 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
149 160
150 debug(""); 161 debug("");
151 debug("Test edge cases for replaceItem()"); 162 debug("Test edge cases for replaceItem()");
152 shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3)", "text 1.x.baseVal.getItem(3)"); 163 shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3)", "text 1.x.baseVal.getItem(3)");
153 shouldBe("text1.x.baseVal.numberOfItems", "4"); 164 shouldBe("text1.x.baseVal.numberOfItems", "4");
154 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); 165 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
155 shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text 1.x.baseVal.getItem(2)"); 166 shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text 1.x.baseVal.getItem(3)");
156 shouldBe("text1.x.baseVal.numberOfItems", "3"); 167 shouldBe("text1.x.baseVal.numberOfItems", "4");
157 shouldBeEqualToString("text1.getAttribute('x')", "1 3 2"); 168 shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 2");
158 shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4)"); 169 shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4)");
159 170
160 debug(""); 171 debug("");
161 debug("Set x='1 2 3 4' for text1"); 172 debug("Set x='1 2 3 4' for text1");
162 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')"); 173 shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
163 174
164 debug(""); 175 debug("");
165 debug("Test uncommon arguments for removeItem()"); 176 debug("Test uncommon arguments for removeItem()");
166 shouldThrow("text1.x.baseVal.removeItem(30)"); 177 shouldThrow("text1.x.baseVal.removeItem(30)");
167 178
(...skipping 20 matching lines...) Expand all
188 debug(""); 199 debug("");
189 debug("Testing animVal clear throws"); 200 debug("Testing animVal clear throws");
190 shouldThrow("text1.x.animVal.clear()"); 201 shouldThrow("text1.x.animVal.clear()");
191 shouldBeUndefined("text1.x.baseVal.clear()"); 202 shouldBeUndefined("text1.x.baseVal.clear()");
192 203
193 gc(); 204 gc();
194 ]]> 205 ]]>
195 </script> 206 </script>
196 </body> 207 </body>
197 </html> 208 </html>
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/SVGLengthList-appendItem-expected.txt ('k') | LayoutTests/svg/dom/SVGLengthList-basics-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698