blob: 9d35a2514887707a8c20961702cc48f6bad96b53 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body id="body">
<div role="listbox">
<div role="option" tabindex="-1">option 1</div>
<div role="option" aria-label="label 2">option 2</div>
</div>
<script>
test((t) => {
var body = document.getElementById("body");
body.focus();
var listBox = accessibilityController.focusedElement.childAtIndex(0);
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>