blob: 03d7afac0fb763b58ea7d46983bbc287ce8fb740 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<title>aria-sort</title>
</head>
<body>
<div role="grid">
<div role="row">
<span role="gridcell"></span>
<!-- Ascending aria-sort direction. -->
<span aria-sort="ascending" id="col1" role="columnheader">column</span>
<!-- Descending aria-sort direction. -->
<span aria-sort="descending" id="col2" role="columnheader">column</span>
<!-- Other aria-sort direction. -->
<span aria-sort="other" id="col3" role="columnheader">column</span>
<!-- The comun header with aria-sort attribute is the parent of a focusable element. -->
<span aria-sort="ascending" id="col4" role="columnheader"><a id="link1" href="#">column</a></span>
</div>
<div role="row">
<!-- No aria-sort direction. -->
<span id="row1" role="rowheader">row</span>
<span role="gridcell"></span>
<span role="gridcell"></span>
<span role="gridcell"></span>
<span role="gridcell"></span>
</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that aria-sort is exposed correctly to the Mac accessibility API.");
if (window.accessibilityController) {
var col1 = accessibilityController.accessibleElementById("col1");
shouldBe("col1.isAttributeSupported('AXSortDirection')", "true");
shouldBe("col1.sortDirection", "'AXAscendingSortDirection'");
var col2 = accessibilityController.accessibleElementById("col2");
shouldBe("col2.isAttributeSupported('AXSortDirection')", "true");
shouldBe("col2.sortDirection", "'AXDescendingSortDirection'");
var col3 = accessibilityController.accessibleElementById("col3");
shouldBe("col3.isAttributeSupported('AXSortDirection')", "true");
shouldBe("col3.sortDirection", "'AXUnknownSortDirection'");
var link1 = accessibilityController.accessibleElementById("link1");
shouldBe("link1.isAttributeSupported('AXSortDirection')", "true");
shouldBe("link1.sortDirection", "'AXAscendingSortDirection'");
var row1 = accessibilityController.accessibleElementById("row1");
shouldBe("row1.isAttributeSupported('AXSortDirection')", "false");
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>