Commit d1d89d7d authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Remove ax::mojom::Event::kMenuListItemSelected

The specific event was fired from Blink but never used anywhere else
in the code, because the event can be implicitly generated. Replace it
with a call to MarkDirty and update web tests.

Bug: 699438
AX-Relnotes: N/A
Change-Id: Ic1d3649da6ee4bcf8e8a0935276e7a95f5ea9671
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440588Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813633}
parent f30f098d
......@@ -594,9 +594,6 @@ void WebFrameTestProxy::PostAccessibilityEvent(const ui::AXEvent& event) {
case ax::mojom::Event::kLocationChanged:
event_name = "LocationChanged";
break;
case ax::mojom::Event::kMenuListItemSelected:
event_name = "MenuListItemSelected";
break;
case ax::mojom::Event::kMenuListValueChanged:
event_name = "MenuListValueChanged";
break;
......
......@@ -63,7 +63,6 @@ bool IsEventTypeHandledByAXEventGenerator(ax::mojom::Event event_type) {
case ax::mojom::Event::kMediaStartedPlaying:
case ax::mojom::Event::kMediaStoppedPlaying:
case ax::mojom::Event::kMenuEnd:
case ax::mojom::Event::kMenuListItemSelected:
case ax::mojom::Event::kMenuListValueChanged:
case ax::mojom::Event::kMenuPopupEnd:
case ax::mojom::Event::kMenuPopupStart:
......
......@@ -137,15 +137,14 @@ void AXMenuListPopup::DidUpdateActiveOption(int option_index,
if (old_index != option_index && old_index >= 0 &&
old_index < static_cast<int>(children_.size())) {
AXObject* previous_child = children_[old_index].Get();
cache.PostNotification(previous_child,
ax::mojom::Event::kMenuListItemSelected);
cache.MarkAXObjectDirty(previous_child, false);
}
if (option_index >= 0 && option_index < static_cast<int>(children_.size())) {
AXObject* child = children_[option_index].Get();
cache.PostNotification(this, ax::mojom::Event::kChildrenChanged);
cache.PostNotification(this, ax::mojom::Event::kActiveDescendantChanged);
cache.PostNotification(child, ax::mojom::Event::kMenuListItemSelected);
cache.MarkAXObjectDirty(child, false);
}
}
......@@ -155,7 +154,7 @@ void AXMenuListPopup::DidHide() {
cache.PostNotification(this, ax::mojom::Event::kHide);
if (descendant) {
cache.PostNotification(this, ax::mojom::Event::kChildrenChanged);
cache.PostNotification(descendant, ax::mojom::Event::kMenuListItemSelected);
cache.MarkAXObjectDirty(descendant, false);
}
}
......
......@@ -19,7 +19,7 @@ async_test(function(t)
assert_equals(element.role, "AXRole: AXMenuListPopup");
++eventCount;
}
if (notification == "MenuListItemSelected") {
if (notification == "MarkDirty") {
assert_equals(element.role, "AXRole: AXMenuListOption");
assert_equals(element.name, "Alicia");
++eventCount;
......
......@@ -16,7 +16,7 @@
<script>
async_test((t) => {
accessibilityController.setNotificationListener(t.step_func((axnode, type) => {
if (type == 'MenuListItemSelected')
if (type == 'MarkDirty' && axnode.role == 'AXRole: AXMenuListOption')
t.done();
}));
var menu = document.getElementById('menu');
......@@ -29,7 +29,7 @@ async_test((t) => {
assert_unreached("Did not receive all accessibility notifications");
t.done();
}, 500);
}, 'Tests if typing an arrow key dispatches a |MenuListItemSelected| a11y event.');
}, 'Tests if typing an arrow key dispatches an a11y event.');
</script>
</body>
......
......@@ -59,8 +59,6 @@ def GetEnumsFromFile(fullpath):
enum_value = CamelToLowerHacker(enum_value[1:])
if enum_value == 'none' or enum_value == 'last':
continue
if enum_value == 'active_descendant_changed':
enum_value = 'activedescendantchanged'
enums[enum_name].append(enum_value)
return enums
......@@ -71,7 +69,8 @@ def CheckMatchingEnum(ax_enums,
automation_enum_name,
errs,
output_api,
strict_ordering=False):
strict_ordering=False,
allow_extra_destination_enums=False):
if ax_enum_name not in ax_enums:
errs.append(output_api.PresubmitError(
'Expected %s to have an enum named %s' % (AX_MOJOM, ax_enum_name)))
......@@ -113,6 +112,7 @@ def CheckMatchingEnum(ax_enums,
automation_enum_name, InitialLowerCamelCase(value),
AUTOMATION_IDL)))
# Should be no remaining items
if not allow_extra_destination_enums:
for value in dst:
errs.append(output_api.PresubmitError(
'Found %s.%s in %s, but did not find %s.%s in %s' % (
......@@ -138,7 +138,7 @@ def CheckEnumsMatch(input_api, output_api):
CheckMatchingEnum(ax_enums, 'Action', automation_enums, 'ActionType', errs,
output_api, strict_ordering=True)
CheckMatchingEnum(ax_enums, 'Event', automation_enums, 'EventType', errs,
output_api)
output_api, allow_extra_destination_enums=True)
CheckMatchingEnum(ax_enums, 'NameFrom', automation_enums, 'NameFromType',
errs, output_api)
CheckMatchingEnum(ax_enums, 'DescriptionFrom', automation_enums,
......
......@@ -75,8 +75,6 @@ const char* ToString(ax::mojom::Event event) {
return "mediaStoppedPlaying";
case ax::mojom::Event::kMenuEnd:
return "menuEnd";
case ax::mojom::Event::kMenuListItemSelected:
return "menuListItemSelected";
case ax::mojom::Event::kMenuListValueChanged:
return "menuListValueChanged";
case ax::mojom::Event::kMenuPopupEnd:
......
......@@ -57,7 +57,6 @@ enum Event {
kMediaStartedPlaying, // Native / Automation
kMediaStoppedPlaying, // Native / Automation
kMenuEnd, // Native / web: menu interaction has ended.
kMenuListItemSelected, // Web
kMenuListValueChanged, // Web
kMenuPopupEnd, // Native / web: a menu/submenu is hidden/closed.
kMenuPopupStart, // Native / web: a menu/submenu is shown/opened.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment