| Index: third_party/WebKit/LayoutTests/accessibility/aria-activedescendant-events.html
|
| diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-activedescendant-events.html b/third_party/WebKit/LayoutTests/accessibility/aria-activedescendant-events.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7e09336f02ef8ce7f7fa9a3cda2d8922de690d03
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/accessibility/aria-activedescendant-events.html
|
| @@ -0,0 +1,99 @@
|
| +<!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +
|
| +<div id="contenteditable-textbox" role="textbox" contenteditable="true"
|
| + aria-expanded="true" aria-haspopup="true" aria-autocomplete="list"
|
| + aria-activedescendant="list1-option1">
|
| + <ul id="list1" role="listbox">
|
| + <li id="list1-option1" role="option">Option 1</li>
|
| + <li id="list1-option2" role="option">Option 2</li>
|
| + <li id="list1-option3" role="option">Option 3</li>
|
| + </ul>
|
| +</div>
|
| +
|
| +<input id="input-textbox" role="textbox" type="text" aria-expanded="true"
|
| + aria-haspopup="true" aria-autocomplete="list"
|
| + aria-activedescendant="list2-option1" aria-owns="list2">
|
| +
|
| +<ul id="list2" role="listbox">
|
| + <li id="list2-option1" role="option">Option 1</li>
|
| + <li id="list2-option2" role="option">Option 2</li>
|
| + <li id="list2-option3" role="option">Option 3</li>
|
| +</ul>
|
| +
|
| +<input id="input-combobox" role="combobox" type="search" aria-expanded="true"
|
| + aria-haspopup="true" aria-autocomplete="list"
|
| + aria-activedescendant="list3-option1" aria-owns="list3">
|
| +
|
| +<ul id="list3" role="listbox">
|
| + <li id="list3-option1" role="option">Option 1</li>
|
| + <li id="list3-option2" role="option">Option 2</li>
|
| + <li id="list3-option3" role="option">Option 3</li>
|
| +</ul>
|
| +
|
| +<textarea id="textarea-searchbox" role="searchbox" aria-expanded="true"
|
| + aria-haspopup="true" aria-autocomplete="list"
|
| + aria-activedescendant="list4-option1" aria-owns="list4"></textarea>
|
| +
|
| +<ul id="list4" role="listbox">
|
| + <li id="list4-option1" role="option">Option 1</li>
|
| + <li id="list4-option2" role="option">Option 2</li>
|
| + <li id="list4-option3" role="option">Option 3</li>
|
| +</ul>
|
| +
|
| +<script>
|
| + function testEventExpectations(t, widgetId, listboxId)
|
| + {
|
| + var listbox = document.getElementById(listboxId);
|
| + var widget = document.getElementById(widgetId);
|
| + var axWidget = accessibilityController.accessibleElementById(widgetId);
|
| + var focusChangedEventCount = 0;
|
| + var activeDescendantChangedEventCount = 0;
|
| + axWidget.addNotificationListener(function(notification)
|
| + {
|
| + if (notification == "Focus")
|
| + ++focusChangedEventCount;
|
| + if (notification == "ActiveDescendantChanged")
|
| + ++activeDescendantChangedEventCount;
|
| + if (focusChangedEventCount == 1 && activeDescendantChangedEventCount == 3) {
|
| + widget.style.display = "none";
|
| + listbox.style.display = "none";
|
| + t.done();
|
| + }
|
| + });
|
| +
|
| + widget.focus();
|
| + widget.setAttribute("aria-activedescendant", listboxId + "-option2");
|
| + widget.setAttribute("aria-activedescendant", listboxId + "-option3");
|
| + widget.removeAttribute("aria-activedescendant");
|
| + }
|
| +</script>
|
| +
|
| +<script>
|
| + async_test(function(t)
|
| + {
|
| + testEventExpectations(t, "contenteditable-textbox", "list1");
|
| + }, "Changing active descendant on a content editable.");
|
| +</script>
|
| +
|
| +<script>
|
| + async_test(function(t)
|
| + {
|
| + testEventExpectations(t, "input-textbox", "list2");
|
| + }, "Changing active descendant on an input with role=textbox.");
|
| +</script>
|
| +
|
| +<script>
|
| + async_test(function(t)
|
| + {
|
| + testEventExpectations(t, "input-combobox", "list3");
|
| + }, "Changing active descendant on an input of type=search with role=combobox.");
|
| +</script>
|
| +
|
| +<script>
|
| + async_test(function(t)
|
| + {
|
| + testEventExpectations(t, "textarea-searchbox", "list4");
|
| + }, "Changing active descendant on a textarea with role=searchbox.");
|
| +</script>
|
|
|