OLD | NEW |
1 description( | 1 description( |
2 'This tests enumerating the elements of DOM lists.' | 2 'This tests enumerating the elements of DOM lists.' |
3 ); | 3 ); |
4 | 4 |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 // Create a testing environment that can be cleanup up easily. | 8 // Create a testing environment that can be cleanup up easily. |
9 var testingGround = document.createElement('div'); | 9 var testingGround = document.createElement('div'); |
10 document.body.appendChild(testingGround); | 10 document.body.appendChild(testingGround); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Window | 90 // Window |
91 | 91 |
92 setup(); | 92 setup(); |
93 | 93 |
94 var resultArray = new Array(); | 94 var resultArray = new Array(); |
95 | 95 |
96 // NodeList | 96 // NodeList |
97 var nodeList = document.querySelectorAll('ol'); | 97 var nodeList = document.querySelectorAll('ol'); |
98 resultArray = iterateList(nodeList); | 98 resultArray = iterateList(nodeList); |
99 | 99 |
100 shouldBe("resultArray.length", "5"); | 100 shouldBe("resultArray.length", "9"); |
101 shouldBe("resultArray[0].i", "'0'"); | 101 shouldBe("resultArray[0].i", "'0'"); |
102 shouldBe("resultArray[0].item", "nodeList.item(0)"); | 102 shouldBe("resultArray[0].item", "nodeList.item(0)"); |
103 shouldBe("resultArray[1].i", "'1'"); | 103 shouldBe("resultArray[1].i", "'1'"); |
104 shouldBe("resultArray[1].item", "nodeList.item(1)"); | 104 shouldBe("resultArray[1].item", "nodeList.item(1)"); |
105 shouldBe("resultArray[2].i", "'2'"); | 105 shouldBe("resultArray[2].i", "'2'"); |
106 shouldBe("resultArray[2].item", "nodeList.item(2)"); | 106 shouldBe("resultArray[2].item", "nodeList.item(2)"); |
107 | 107 |
108 // HTMLCollection | 108 // HTMLCollection |
109 var htmlCollection = document.forms; | 109 var htmlCollection = document.forms; |
110 resultArray = iterateList(htmlCollection); | 110 resultArray = iterateList(htmlCollection); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 shouldBe("resultArray[0].i", "'0'"); | 187 shouldBe("resultArray[0].i", "'0'"); |
188 shouldBe("resultArray[0].item", "mediaList.item(0)"); | 188 shouldBe("resultArray[0].item", "mediaList.item(0)"); |
189 shouldBe("resultArray[1].i", "'1'"); | 189 shouldBe("resultArray[1].i", "'1'"); |
190 shouldBe("resultArray[1].item", "mediaList.item(1)"); | 190 shouldBe("resultArray[1].item", "mediaList.item(1)"); |
191 shouldBe("resultArray[2].i", "'2'"); | 191 shouldBe("resultArray[2].i", "'2'"); |
192 shouldBe("resultArray[2].item", "mediaList.item(2)"); | 192 shouldBe("resultArray[2].item", "mediaList.item(2)"); |
193 | 193 |
194 debug(""); | 194 debug(""); |
195 | 195 |
196 document.body.removeChild(testingGround); | 196 document.body.removeChild(testingGround); |
OLD | NEW |