|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=849438 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="utf-8"> |
|
8 <title>Test for <select> list control search</title> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
12 <script type="application/javascript"> |
|
13 |
|
14 /** This test will focus a select element and press a key that matches the |
|
15 first non-space character of an entry. **/ |
|
16 |
|
17 SimpleTest.waitForExplicitFinish(); |
|
18 SimpleTest.waitForFocus(function() { |
|
19 var select = document.getElementsByTagName('select')[0]; |
|
20 select.focus(); |
|
21 synthesizeKey('a', {}); |
|
22 |
|
23 is(select.options[0].selected, false, "the first option isn't selected"); |
|
24 is(select.options[1].selected, true, "the second option is selected"); |
|
25 |
|
26 select.blur(); |
|
27 |
|
28 SimpleTest.finish(); |
|
29 }); |
|
30 |
|
31 </script> |
|
32 </head> |
|
33 <body> |
|
34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=849438">Mozilla Bug 849438</a> |
|
35 <p id="display"></p> |
|
36 <div id="content"> |
|
37 <select> |
|
38 <option>Please select an entry</option> |
|
39 <option> a</option> |
|
40 <option> b</option> |
|
41 </select> |
|
42 </div> |
|
43 <pre id="test"> |
|
44 </pre> |
|
45 </body> |
|
46 </html> |