jdiggs@igalia.com | 0824e0a5 | 2016-11-04 16:48:12 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <script src="../resources/js-test-pre.js"></script> |
| 5 | </head> |
| 6 | <body id="body"> |
| 7 | <select id="listbox" multiple="multiple"> |
| 8 | <option>Option 1</option> |
| 9 | <option>Option 2</option> |
| 10 | </select> |
| 11 | <div id="description"></div> |
| 12 | <div id="console"></div> |
| 13 | <script> |
| 14 | description("Tests clearing the selection of a multi-select select element."); |
| 15 | if (window.accessibilityController) { |
| 16 | var listbox = accessibilityController.accessibleElementById("listbox"); |
| 17 | shouldBe("listbox.selectedChildrenCount", "0"); |
| 18 | |
| 19 | listbox.setSelectedChildAtIndex(0); |
| 20 | shouldBe("listbox.selectedChildrenCount", "1"); |
| 21 | |
| 22 | listbox.setSelectedChildAtIndex(1); |
| 23 | shouldBe("listbox.selectedChildrenCount", "2"); |
| 24 | |
| 25 | listbox.clearSelectedChildren(); |
| 26 | shouldBe("listbox.selectedChildrenCount", "0"); |
| 27 | } |
| 28 | </script> |
| 29 | <script src="../resources/js-test-post.js"></script> |
| 30 | </body> |
| 31 | </html> |