blob: 8f1ba85d8e2c18eb9704028412c386dd435442b9 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="../../resources/accessibility-helper.js"></script>
</head>
<body id="body">
<div id="tree" role="tree">
<div id="group2-item2" role="treeitem" aria-level="3" aria-setsize="2" aria-posinset="2" aria-current="page">Jaguar</div>
<div id="item-1" role="treeitem" aria-level="1" aria-expanded="true" tabindex="0">Jungle Animals
<div role="group" aria-owns="group1-item2 group1-item3 non-existent-item1">
<div id="group1-item3" role="treeitem" aria-level="2" aria-setsize="3" aria-posinset="3" aria-current="page">Birds</div>
<div id="group1-item1" role="treeitem" aria-level="2" aria-setsize="3" aria-posinset="1" aria-current="page">Reptiles</div>
</div>
</div>
<div id="group1-item2" role="treeitem" aria-level="2" aria-expanded="true" aria-setsize="1" aria-posinset="2" aria-current="page">Cats
<div role="group" aria-owns="group2-item1 group2-item2"></div>
</div>
<div id="group2-item1" role="treeitem" aria-level="3" aria-posinset="1" aria-setsize="2" aria-current="page">Lion</div>
<div id="item-2" role="treeitem" aria-level="1" aria-expanded="false" tabindex="-1">Domestic Animals</div>
</div>
<script>
description("This tests that a treeitem with a group that uses aria-owns will report its disclosed rows correctly.");
if (window.accessibilityController) {
var tree = accessibilityController.accessibleElementById("tree");
var treeitem1 = tree.rowAtIndex(0);
var treeitem1_1 = treeitem1.disclosedRowAtIndex(0);
var treeitem1_2 = treeitem1.disclosedRowAtIndex(1);
var treeitem1_3 = treeitem1.disclosedRowAtIndex(4);
var treeitem1_2_1 = treeitem1_2.disclosedRowAtIndex(0);
var treeitem1_2_2 = treeitem1_2.disclosedRowAtIndex(1);
var treeitem2 = tree.rowAtIndex(6);
shouldBe("tree.childrenCount", "7");
shouldBeTrue("treeitem1.isEqual(accessibilityController.accessibleElementById('item-1'))");
shouldBeTrue("treeitem1_1.isEqual(accessibilityController.accessibleElementById('group1-item1'))");
shouldBeTrue("treeitem1_2.isEqual(accessibilityController.accessibleElementById('group1-item2'))");
shouldBeTrue("treeitem1_3.isEqual(accessibilityController.accessibleElementById('group1-item3'))");
shouldBeTrue("treeitem1_2_1.isEqual(accessibilityController.accessibleElementById('group2-item1'))");
shouldBeTrue("treeitem1_2_2.isEqual(accessibilityController.accessibleElementById('group2-item2'))");
shouldBeTrue("treeitem2.isEqual(accessibilityController.accessibleElementById('item-2'))");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>