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

Side by Side Diff: LayoutTests/fast/dom/HTMLSelectElement/select-element-item-argument.html

Issue 21834002: HTMLSelectElement.item() does not behave according to specification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move test as advised Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLSelectElement/select-element-item-argument-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="help" href="http://www.w3.org/TR/html51/forms.html#dom-select-item">
5 <script src="../../js/resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <select id="target">
9 <option value="a">a</option>
10 <option value="b">b</option>
11 <option value="c">c</option>
12 <option value="d">d</option>
13 </select>
14
15 <script>
16 description("Tests that the HTMLSelectElement.item() argument is correctly valid ated.");
17
18 var select = document.getElementById('target');
19 shouldBe("select.__proto__", "HTMLSelectElement.prototype");
20
21 // getter Node item(unsigned long index);
22 shouldBeEqualToString("select.item(0).value", "a");
23 shouldBeEqualToString("select.item(1).value", "b");
24 shouldBeEqualToString("select.item(2).value", "c");
25 shouldBeEqualToString("select.item(3).value", "d");
26 shouldBeNull("select.item(4)");
27 shouldBeNull("select.item(-1)"); // Offset is too large (after wrapping)
28 shouldBeEqualToString("select.item(-4294967294).value", "c"); // Wraps to 2, whi ch is a valid offset.
29 shouldThrow("select.item()", "'TypeError: Not enough arguments'");
30
31 </script>
32 <script src="../../js/resources/js-test-post.js"></script>
33 </body>
34 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLSelectElement/select-element-item-argument-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698