Index: third_party/WebKit/LayoutTests/accessibility/aria-row-name.html |
diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-row-name.html b/third_party/WebKit/LayoutTests/accessibility/aria-row-name.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..02e65c0713539ef7b3f5ddf070b4ea094cf97866 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/accessibility/aria-row-name.html |
@@ -0,0 +1,45 @@ |
+<!DOCTYPE HTML> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<body id="body"> |
+<div role="treegrid"> |
+ <div role="row" id="treegrid1-row1" tabindex="-1"> |
+ <div role="rowheader">row head</div> |
+ <div role="gridcell">data</div> |
+ </div> |
+</div> |
+<div role="treegrid" aria-activedescendant="treegrid2-row1"> |
+ <div role="row" id="treegrid2-row1"> |
+ <div role="rowheader">row head</div> |
+ <div role="gridcell">data</div> |
+ </div> |
+</div> |
+<div role="grid"> |
+ <div role="row" id="treegrid3-row1"> |
+ <div role="rowheader">row head</div> |
+ <div role="gridcell">data</div> |
+ </div> |
+</div> |
+</body> |
+ |
+<script> |
+function axElementById(id) { |
+ return accessibilityController.accessibleElementById(id); |
+} |
+ |
+test(function(t) { |
+ var axRow = axElementById("treegrid1-row1"); |
+ assert_equals(axRow.name, 'row head data'); |
+}, "The row's name must concatenate the children if the row is focusable"); |
+ |
+test(function(t) { |
+ var axRow = axElementById("treegrid2-row1"); |
+ assert_equals(axRow.name, 'row head data'); |
+}, "The row's name must concatenate the children if the parent has aria-activedescendant"); |
+ |
+test(function(t) { |
+ var axRow = axElementById("treegrid3-row1"); |
+ assert_equals(axRow.name, ''); |
+}, "The row's name must empty when the parent is not focusable and there is no other labelling markup (for performance reasons)"); |
+ |
+</script> |