AX: WebKit doesn't map aria-sort=other on OS X
[WebKit-https.git] / LayoutTests / accessibility / aria-sort.html
index 71568b80d863bfd716d084eda240e5c85df7685f..e8013fda88243bb3aaaeb811f488a72c02a175c7 100644 (file)
@@ -1,16 +1,27 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
 <html>
 <head>
 <script src="../resources/js-test-pre.js"></script>
+<title>aria-sort</title>
 </head>
-<body id="body">
-
-<div tabindex="0" id="button" role="button">button</div>
+<body>
 
 <div role="grid">
 <div role="row">
-<div role="columnheader" aria-sort="ascending" tabindex="0" id="column">column</div>
-<div role="rowheader" aria-sort="descending" tabindex="0" id="row">row</div> 
+<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>
+</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>
 </div>
 </div>
 
 <div id="console"></div>
 
 <script>
-
-    description("This tests that aria-sort will be exposed correctly to the Mac accessibility API.");
-
+    description("This tests that aria-sort is exposed correctly to the Mac accessibility API.");
+    
     if (window.accessibilityController) {
-
-        document.getElementById("button").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXUnknownSortDirection'");
-
-        document.getElementById("column").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXAscendingSortDirection'");
-
-        document.getElementById("row").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXDescendingSortDirection'");
+        var col1 = accessibilityController.accessibleElementById("col1");
+        shouldBe("col1.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col1.stringAttributeValue('AXSortDirection')", "'AXAscendingSortDirection'");
+        
+        var col2 = accessibilityController.accessibleElementById("col2");
+        shouldBe("col2.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col2.stringAttributeValue('AXSortDirection')", "'AXDescendingSortDirection'");
+        
+        var col3 = accessibilityController.accessibleElementById("col3");
+        shouldBe("col3.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col3.stringAttributeValue('AXSortDirection')", "'AXUnknownSortDirection'");
+        
+        var row1 = accessibilityController.accessibleElementById("row1");
+        shouldBe("row1.isAttributeSupported('AXSortDirection')", "false");
     }
-
 </script>
 
 <script src="../resources/js-test-post.js"></script>