haikuwebkit/LayoutTests/accessibility/combo-box-collapsed-selecti...

58 lines
1.5 KiB
HTML
Raw Permalink Normal View History

[ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard https://bugs.webkit.org/show_bug.cgi?id=133512 Reviewed by Chris Fleizach. Source/WebCore: Make sure that AccessibilityMenuList objects update their active option when it changes, which will send a platform-dependent accessibility-related notification when needed. Test: accessibility/combo-box-collapsed-selection-changed.html * rendering/RenderMenuList.cpp: (RenderMenuList::didUpdateActiveOption): Keep the out-of-bounds check for the index passed but don't avoid updating the option for the associated AccessibilityMenuList object if the selected list item does not have a renderer, because that could be the case for cases where the popup (and its elements) would be rendered in the UI Process (e.g. GTK+ port uses GtkMenu and GtkMenuItem for that). * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::didUpdateActiveOption): Ensure that the AccessibilityMenuListPopup object for a given menu list has accessibility children before updating its active option. Tools: Added support for connecting to AtkSelection's 'selection-changed' signal, and print it out as AXSelectedChildrenChanged in the tests. Also removed some dead code, that became useless after r169487. * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp: (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): Updated. LayoutTests: Re-implemented test for combo boxes in terms of addNotificationListener() instead of using the (already deprecated) logAccessibilityEvents method, and made the test cross platform (as the fix is not platform specific). * accessibility/combo-box-collapsed-selection-changed.html: Implemented based on the former gtk-only test, and made it cross-platform. * accessibility/combo-box-collapsed-selection-changed-expected.txt: New. * platform/gtk/accessibility/combo-box-collapsed-selection-changed.html: Removed. * platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Removed. Updated expectation for test that checks that a notification is sent when navigating through a multiselection list box, now that we are actually printing such a notification. * accessibility/multiselect-list-reports-active-option-expected.txt: Updated. Removed two expected failures from TestExpectations for tests that are now passing, one for the combo box test mentioned above and another one for a test that is passing as well now, after applying this fix: accessibility/menu-list-sends-change-notification.html * platform/gtk/TestExpectations: Removed two 'failure' expectations. * platform/mac/TestExpectations: Skip accessiblity test timing out, probably because those kind of notifications while navigating a combo box are not needed in the Mac. Canonical link: https://commits.webkit.org/151884@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-16 15:01:06 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script>
</script>
</head>
<body>
<form>
<select id="combo">
<option selected value='foo'>foo</option>
<option value='bar'>bar</option>
<option value='baz'>baz</option>
</select>
</form>
<p id="description"></p>
<div id="console"></div>
<script>
window.jsTestIsAsync = true;
description("This tests that a combo box notifies when the selected child has changed while arrowing through the options of a combobox while collapsed.");
var selectionChangedNotifications = 0;
if (window.testRunner && window.accessibilityController) {
testRunner.dumpAsText();
// Focus in the combobox and move around the options. The signal
// 'state-change:selected' should be emitted with every change.
document.getElementById("combo").focus();
axCombo = accessibilityController.focusedElement;
axCombo.addNotificationListener(function (notification) {
if (notification == "AXSelectedChildrenChanged")
selectionChangedNotifications++;
});
eventSender.keyDown("downArrow");
eventSender.keyDown("downArrow");
eventSender.keyDown("upArrow");
eventSender.keyDown("upArrow");
window.setTimeout(function() {
if (window.accessibilityController)
axCombo.removeNotificationListener();
shouldBe("selectionChangedNotifications", "4");
finishJSTest();
}, 0);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>