Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <title>SVGLengthList, removeItem()</title> | |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharnessreport.js"></script> | |
| 5 <svg width="200" height="200"> | |
| 6 <text x="500 50 100 900 150" y="50">ABC</text> | |
| 7 </svg> | |
| 8 <script> | |
| 9 test(function() { | |
| 10 // This is a test of the SVGLengthList::removeItem() API. | |
|
fs
2016/09/17 17:42:37
Like in previous test(s)
Shanmuga Pandi
2016/09/19 07:40:04
Done.
| |
| 11 var list = document.querySelector("text").x.baseVal; | |
| 12 | |
| 13 // Check initial list state of text. | |
| 14 assert_equals(list.numberOfItems, 5); | |
| 15 assert_equals(list.getItem(0).value, 500); | |
| 16 assert_equals(list.getItem(1).value, 50); | |
| 17 assert_equals(list.getItem(2).value, 100); | |
| 18 assert_equals(list.getItem(3).value, 900); | |
| 19 assert_equals(list.getItem(4).value, 150); | |
| 20 assert_throws("IndexSizeError", function() { list.getItem(5); }); | |
| 21 | |
| 22 // Remove fourth item of text. | |
|
fs
2016/09/17 17:42:37
s/fourth/first/? (Can probably drop "of text" too.
Shanmuga Pandi
2016/09/19 07:40:04
Done.
| |
| 23 assert_equals(list.removeItem(0).value, 500); | |
| 24 | |
| 25 // Remove third item of text. | |
| 26 assert_equals(list.removeItem(2).value, 900); | |
| 27 }); | |
| 28 </script> | |
| OLD | NEW |