blob: e90a4ba86adcdf33f91de9afef6b54defc3eb968 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<body id="body">
<script src="../../resources/js-test.js"></script>
<script src="../../resources/accessibility-helper.js"></script>
<custom-list id="custom-list"></custom-checkbox>
<custom-list id="custom-textbox" role="textbox" aria-autocomplete="inline"></custom-checkbox>
<script>
customElements.define('custom-list', class CustomElement extends HTMLElement {
constructor()
{
super();
const internals = this.attachInternals();
internals.role = 'combobox';
internals.ariaAutoComplete = 'list';
}
});
description("This tests that aria fallback roles work correctly.");
if (!window.accessibilityController)
debug('This test requires accessibilityController');
else {
shouldBeEqualToString('accessibilityController.accessibleElementById("custom-list").role', 'AXRole: AXComboBox');
shouldBeEqualToString('accessibilityController.accessibleElementById("custom-list").stringAttributeValue("AXAutocompleteValue")', 'list');
shouldBeEqualToString('accessibilityController.accessibleElementById("custom-textbox").role', 'AXRole: AXTextField');
shouldBeEqualToString('accessibilityController.accessibleElementById("custom-textbox").stringAttributeValue("AXAutocompleteValue")', 'inline');
}
</script>
</body>
</html>