| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <div id="container"> |
| <div role="listbox"> |
| <div role="option" tabindex="-1">option 1</div> |
| <div role="option" aria-label="label 2">option 2</div> |
| </div> |
| </div> |
| </div> |
| |
| <script> |
| test((t) => { |
| var container = accessibilityController.accessibleElementById("container"); |
| var listBox = container.childAtIndex(0); |
| assert_equals(listBox.role, "AXRole: AXListBox"); |
| |
| var firstChild = listBox.childAtIndex(0); |
| var secondChild = listBox.childAtIndex(1); |
| assert_equals(firstChild.role, "AXRole: AXListBoxOption"); |
| assert_equals(firstChild.name, "option 1"); |
| |
| assert_equals(secondChild.role, "AXRole: AXListBoxOption"); |
| assert_equals(secondChild.name, "label 2"); |
| |
| assert_equals(firstChild.childrenCount, 0); |
| assert_equals(secondChild.childrenCount, 0); |
| |
| assert_equals(firstChild.isFocusable, true); |
| }, "This tests that the aria 'option' role works as expected. That is, it becomes a static text element with no children."); |
| |
| </script> |
| |
| </body> |
| </html> |