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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/script-tests/domListEnumeration.js

Issue 1367523002: [dom] support iterable<> NodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actual on the left, expected on the right Created 5 years, 1 month 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 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
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698