OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 <select id="listbox" size="3"> | 4 <select id="listbox" size="3"> |
5 <option id="item0">Alicia</option> | 5 <option id="item0">Alicia</option> |
6 <option id="item1">Peter</option> | 6 <option id="item1">Peter</option> |
7 <option id="item2">Kalinda</option> | 7 <option id="item2">Kalinda</option> |
| 8 <option id="item3" disabled>Frank</option> |
8 </select> | 9 </select> |
9 <script> | 10 <script> |
10 async_test(function(t) | 11 async_test(function(t) |
11 { | 12 { |
12 var listbox = document.getElementById("listbox"); | 13 var listbox = document.getElementById("listbox"); |
13 listbox.selectedIndex = 0; | 14 listbox.selectedIndex = 0; |
14 listbox.focus(); | 15 listbox.focus(); |
15 | 16 |
16 accessibilityController.accessibleElementById('dummy'); | 17 accessibilityController.accessibleElementById('dummy'); |
17 | 18 |
(...skipping 12 matching lines...) Expand all Loading... |
30 gotSelectedChildrenChanged = true; | 31 gotSelectedChildrenChanged = true; |
31 } | 32 } |
32 if (gotCheckedStateChanged && gotSelectedChildrenChanged) { | 33 if (gotCheckedStateChanged && gotSelectedChildrenChanged) { |
33 t.done(); | 34 t.done(); |
34 } | 35 } |
35 })); | 36 })); |
36 | 37 |
37 listbox.selectedIndex = 1; | 38 listbox.selectedIndex = 1; |
38 }, 0); | 39 }, 0); |
39 }, "menu list fires correct events when active index changes."); | 40 }, "menu list fires correct events when active index changes."); |
| 41 |
| 42 function axElementById(id) { |
| 43 return accessibilityController.accessibleElementById(id); |
| 44 } |
| 45 |
| 46 test(function(t) { |
| 47 var axOption = axElementById("item2"); |
| 48 assert_equals(axOption.isFocusable, true); |
| 49 }, "Listbox option is focusable"); |
| 50 |
| 51 test(function(t) { |
| 52 var axOption = axElementById("item3"); |
| 53 assert_equals(axOption.isFocusable, false); |
| 54 }, "Disabled listbox option is not focusable"); |
40 </script> | 55 </script> |
OLD | NEW |