blob: aa710745f79727c9cc8f0466771ff6dad6c83c75 [file] [edit]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/accessibility-helper.js"></script>
<script src="../../resources/js-test.js"></script>
<style>
#oversized { width: 200vw; height: 200vh; }
</style>
</head>
<body>
<div id="oversized"></div>
<script>
var output = "This test ensures the scroll view's AXContents is its children with the scroll bars removed, so an assistive technology asking for content does not get the scroll bars back.\n\n";
function countOfRole(attributeName, role)
{
var elements = scrollArea.uiElementArrayAttributeValue(attributeName);
return elements.filter(element => element.role === `AXRole: ${role}`).length;
}
function lengthOf(attributeName)
{
return scrollArea.uiElementArrayAttributeValue(attributeName).length;
}
if (window.accessibilityController) {
var scrollArea = accessibilityController.rootElement;
output += expect("countOfRole('AXChildren', 'AXScrollBar')", "2");
output += expect("countOfRole('AXContents', 'AXScrollBar')", "0");
output += expect("countOfRole('AXContents', 'AXWebArea')", "1");
output += expect("lengthOf('AXContents') === lengthOf('AXChildren') - 2", "true");
debug(output);
}
</script>
</body>
</html>