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

Side by Side Diff: LayoutTests/fast/dom/htmlformcontrolscollection-enumerated-properties.html

Issue 906963002: layout tests: Fixes property enumeration tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <form id="testForm"> 5 <form id="testForm">
6 <input id="id1" name="name1"></input> 6 <input id="id1" name="name1"></input>
7 <input id="id2" name="name1"></input> 7 <input id="id2" name="name1"></input>
8 <input id="id3"></input> 8 <input id="id3"></input>
9 <input id="id4" name="name4"></input> 9 <input id="id4" name="name4"></input>
10 <input name="name5"></input> 10 <input name="name5"></input>
11 <input id="id4" name="name6"></input> 11 <input id="id4" name="name6"></input>
12 </form> 12 </form>
13 13
14 <script> 14 <script>
15 description("This tests verifies the enumerated properties on HTMLFormControlsCo llection and their order."); 15 description("This tests verifies the enumerated properties on HTMLFormControlsCo llection and their order.");
16 16
17 var testForm = document.getElementById("testForm"); 17 var testForm = document.getElementById("testForm");
18 var htmlFormControlsCollection = testForm.elements; 18 var htmlFormControlsCollection = testForm.elements;
19 shouldBe("htmlFormControlsCollection.__proto__", "HTMLFormControlsCollection.pro totype"); 19 shouldBe("htmlFormControlsCollection.__proto__", "HTMLFormControlsCollection.pro totype");
20 shouldBe("htmlFormControlsCollection.__proto__.__proto__", "HTMLCollection.proto type"); 20 shouldBe("htmlFormControlsCollection.__proto__.__proto__", "HTMLCollection.proto type");
21 shouldBe("htmlFormControlsCollection.length", "6"); 21 shouldBe("htmlFormControlsCollection.length", "6");
22 22
23 // As per http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom -interfaces.html#htmlformcontrolscollection-0: 23 // As per http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom -interfaces.html#htmlformcontrolscollection-0:
24 // - The object's supported property indices are as defined for HTMLCollection o bjects. 24 // - The object's supported property indices are as defined for HTMLCollection o bjects.
25 // - The supported property names consist of the non-empty values of all the id and name attributes of all the elements 25 // - The supported property names consist of the non-empty values of all the id and name attributes of all the elements
26 // represented by the collection, in tree order, ignoring later duplicates, wi th the id of an element preceding its name if 26 // represented by the collection, in tree order, ignoring later duplicates, wi th the id of an element preceding its name if
27 // it contributes both, they differ from each other, and neither is the duplic ate of an earlier entry. 27 // it contributes both, they differ from each other, and neither is the duplic ate of an earlier entry.
28 var expectedEnumeratedProperties = ["0", "1" , "2", "3", "4", "5", "length", "id 1", "name1", "id2", "id3", "id4", "name4", "name5", "name6", "namedItem", "item" ]; 28 var expectedEnumeratedProperties = ["0", "1" , "2", "3", "4", "5", "length", "id 1", "name1", "id2", "id3", "id4", "name4", "name5", "name6", "namedItem", "item" ].sort();
29 29
30 var enumeratedProperties = []; 30 var enumeratedProperties = [];
31 for (var property in htmlFormControlsCollection) { 31 for (var property in htmlFormControlsCollection) {
32 enumeratedProperties[enumeratedProperties.length] = property; 32 enumeratedProperties[enumeratedProperties.length] = property;
33 } 33 }
34 enumeratedProperties.sort();
34 shouldBe("enumeratedProperties", "expectedEnumeratedProperties"); 35 shouldBe("enumeratedProperties", "expectedEnumeratedProperties");
35 </script> 36 </script>
36 </body> 37 </body>
37 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698