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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/SVGLengthList-replaceItem.html

Issue 2354503002: Refactor LayoutTests/svg/dom/SVGLengthList*.html (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <title>SVGLengthList, replaceItem()</title> 2 <title>SVGLengthList, replaceItem()</title>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="resources/SVGLengthList-helper.js"></script>
5 <svg width="200" height="200"> 6 <svg width="200" height="200">
6 <text id="text1" x="500 1000 1500" y="50"> ABC </text> 7 <text id="text1" x="500 1000 1500" y="50"> ABC </text>
7 <text id="text2" x="500 100 150 50" y="75"> ABC </text> 8 <text id="text2" x="500 100 150 50" y="75"> ABC </text>
8 <text id="text3" x="50 50 100 100 150" y="100"> ABC</text> 9 <text id="text3" x="50 50 100 100 150" y="100"> ABC</text>
9 <text id="text4" x="100 50 150 150" y="125"> ABC</text> 10 <text id="text4" x="100 50 150 150" y="125"> ABC</text>
10 </svg> 11 </svg>
11 <script> 12 <script>
12 function assert_list(list, expectedValues) {
13 assert_equals(list.numberOfItems, expectedValues.length);
14 for (var index = 0; index < expectedValues.length; ++index)
15 assert_equals(list.getItem(index).value, expectedValues[index]);
16
17 assert_throws("IndexSizeError", function() { list.getItem(expectedValues.lengt h); });
18 }
19
20 test(function() { 13 test(function() {
21 // This is a test of the SVGLengthList.replaceItem() API. 14 // This is a test of the SVGLengthList.replaceItem() API.
22 15
23 var svg = document.querySelector("svg"); 16 var svg = document.querySelector("svg");
24 var list1 = document.getElementById("text1").x.baseVal; 17 var list1 = document.getElementById("text1").x.baseVal;
25 var list2 = document.getElementById("text2").x.baseVal; 18 var list2 = document.getElementById("text2").x.baseVal;
26 var list3 = document.getElementById("text3").x.baseVal; 19 var list3 = document.getElementById("text3").x.baseVal;
27 var list4 = document.getElementById("text4").x.baseVal; 20 var list4 = document.getElementById("text4").x.baseVal;
28 21
29 // Create three SVGLength objects, with values=50,100,150. 22 // Create three SVGLength objects, with values=50,100,150.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Check final list state of text2. 83 // Check final list state of text2.
91 assert_list(list2, [50, 100, 150, 50]); 84 assert_list(list2, [50, 100, 150, 50]);
92 85
93 // Check final list state of text3. 86 // Check final list state of text3.
94 assert_list(list3, [50, 100, 150, 100, 150]); 87 assert_list(list3, [50, 100, 150, 100, 150]);
95 88
96 // Check final list state of text4. 89 // Check final list state of text4.
97 assert_list(list4, [50, 100, 150, 150]); 90 assert_list(list4, [50, 100, 150, 150]);
98 }); 91 });
99 </script> 92 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698