Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <div id="container"></div> | 5 <div id="container"></div> |
| 6 <form></form> | 6 <form></form> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 description("This tests verifies that namedItem and named getter returns the fir st matched item for all but all, options, and form controls collections."); | 9 description("This tests verifies that namedItem and named getter returns the fir st matched item for all but all, options, and form controls collections."); |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 var attrs = attributes ? ", " + JSON.stringify(attributes) : ''; | 85 var attrs = attributes ? ", " + JSON.stringify(attributes) : ''; |
| 86 shouldBe("elements[" + i + "] = insertElementWithId('" + elementNames[i] + "', 'foo'" + attrs + "); " | 86 shouldBe("elements[" + i + "] = insertElementWithId('" + elementNames[i] + "', 'foo'" + attrs + "); " |
| 87 + collection + ".length", (initialLength + i + 1).toString()); | 87 + collection + ".length", (initialLength + i + 1).toString()); |
| 88 } | 88 } |
| 89 shouldBe(collection + "['foo']", "elements[0]"); | 89 shouldBe(collection + "['foo']", "elements[0]"); |
| 90 shouldBe("removeTestElements(); " + collection + ".length", initialLength.to String()); | 90 shouldBe("removeTestElements(); " + collection + ".length", initialLength.to String()); |
| 91 debug(""); | 91 debug(""); |
| 92 } | 92 } |
| 93 | 93 |
| 94 testFirstItemReturnsFirstMatch('document.images', 0, ['img', 'img']); | 94 testFirstItemReturnsFirstMatch('document.images', 0, ['img', 'img']); |
| 95 testFirstItemReturnsFirstMatch('document.applets', 0, ['applet', 'applet']); | 95 testFirstItemReturnsFirstMatch('document.applets', 0, ['object', 'object'], {'ty pe': 'application/x-java-applet'}); |
|
dcheng
2015/08/19 18:44:17
Ditto: I updated this test to use an <object> tag
| |
| 96 testFirstItemReturnsFirstMatch('document.embeds', 0, ['embed', 'embed']); | 96 testFirstItemReturnsFirstMatch('document.embeds', 0, ['embed', 'embed']); |
| 97 testFirstItemReturnsFirstMatch('document.forms', 1, ['form', 'form']); | 97 testFirstItemReturnsFirstMatch('document.forms', 1, ['form', 'form']); |
| 98 testFirstItemReturnsFirstMatch('document.links', 0, ['a', 'a', 'area'], {'href': 'some url'}); | 98 testFirstItemReturnsFirstMatch('document.links', 0, ['a', 'a', 'area'], {'href': 'some url'}); |
| 99 testFirstItemReturnsFirstMatch('document.anchors', 0, ['a', 'a'], {'name': 'some name'}); | 99 testFirstItemReturnsFirstMatch('document.anchors', 0, ['a', 'a'], {'name': 'some name'}); |
| 100 testFirstItemReturnsFirstMatch('document.scripts', 2, ['script', 'script']); | 100 testFirstItemReturnsFirstMatch('document.scripts', 2, ['script', 'script']); |
| 101 | 101 |
| 102 var successfullyParsed = true; | 102 var successfullyParsed = true; |
| 103 | 103 |
| 104 </script> | 104 </script> |
| 105 </body> | 105 </body> |
| 106 </html> | 106 </html> |
| OLD | NEW |