Fixed status announcements interrupting page information for the web navigation.

This commit is contained in:
Storm Dragon
2026-05-15 01:54:17 -04:00
parent 922ba60445
commit b224d699c0
4 changed files with 109 additions and 4 deletions
@@ -42,6 +42,46 @@ class StructuralNavigationTableRegressionTests(unittest.TestCase):
interrupt=False,
)
def test_wrapping_announcement_does_not_interrupt_wrapped_object(self):
navigator = structural_navigation.StructuralNavigation.__new__(
structural_navigation.StructuralNavigation
)
script = mock.Mock()
script.utilities.isZombie.return_value = False
script.utilities.isHidden.return_value = False
script.utilities.isEmpty.return_value = False
script.utilities.pathComparison.return_value = 0
navigator._script = script
first = object()
current = object()
structuralNavigationObject = mock.Mock()
structuralNavigationObject.predicate = None
events = []
structuralNavigationObject.present.side_effect = lambda obj, arg=None: events.append(
("present", obj, arg)
)
script.presentMessage.side_effect = lambda message, **kwargs: events.append(
("message", message, kwargs)
)
navigator._getAll = mock.Mock(return_value=[first, current])
with (
mock.patch.object(structural_navigation.settings, "wrappedStructuralNavigation", True),
mock.patch.object(structural_navigation.AXObject, "is_dead", return_value=False),
mock.patch.object(structural_navigation.AXObject, "get_parent", return_value=None),
mock.patch.object(structural_navigation.AXObject, "get_path", side_effect=lambda obj: [id(obj)]),
):
navigator.goObject(structuralNavigationObject, True, current, "arg")
self.assertEqual(
events,
[
("present", first, "arg"),
("message", messages.WRAPPING_TO_TOP, {"interrupt": False}),
],
)
if __name__ == "__main__":
unittest.main()