[at-spi2-core: 5/17] registryd: Add test for GetInterfaces, and add missing ifaces to the method's implementation




commit 6525e8f8a49c8ee88181da3f2668310395bb2529
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 1 17:49:09 2022 -0500

    registryd: Add test for GetInterfaces, and add missing ifaces to the method's implementation
    
    The registry's root object also handles the Application and Socket
    interfaces, but they were not advertised by its Accessible.GetInterfaces method.

 registryd/registry.c                    | 8 ++++++--
 tests/registryd/test_root_accessible.py | 8 ++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/registryd/registry.c b/registryd/registry.c
index 7a8e62dc..0df7befc 100644
--- a/registryd/registry.c
+++ b/registryd/registry.c
@@ -845,15 +845,19 @@ impl_GetInterfaces (DBusMessage * message, SpiRegistry *registry)
   DBusMessageIter iter, iter_array;
 
   const char *acc = SPI_DBUS_INTERFACE_ACCESSIBLE;
+  const char *app = SPI_DBUS_INTERFACE_APPLICATION;
   const char *com = SPI_DBUS_INTERFACE_COMPONENT;
+  const char *sock = SPI_DBUS_INTERFACE_SOCKET;
 
   reply = dbus_message_new_method_return (message);
 
   dbus_message_iter_init_append (reply, &iter);
   dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "s",
                                     &iter_array);
-    dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &acc);
-    dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &com);
+  dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &acc);
+  dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &app);
+  dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &com);
+  dbus_message_iter_append_basic (&iter_array, DBUS_TYPE_STRING, &sock);
   dbus_message_iter_close_container (&iter, &iter_array);
 
   return reply;
diff --git a/tests/registryd/test_root_accessible.py b/tests/registryd/test_root_accessible.py
index 8a6199a2..bfa70cea 100644
--- a/tests/registryd/test_root_accessible.py
+++ b/tests/registryd/test_root_accessible.py
@@ -24,3 +24,11 @@ def test_accessible_iface_properties(registry_root, session_manager):
 
 def test_unknown_property_yields_error(registry_root, session_manager):
     check_unknown_property_yields_error(registry_root, ACCESSIBLE_IFACE)
+
+def test_root_get_interfaces(registry_root, session_manager):
+    ifaces = registry_root.GetInterfaces(dbus_interface=ACCESSIBLE_IFACE)
+    assert ifaces.signature == 's'
+    assert 'org.a11y.atspi.Accessible' in ifaces
+    assert 'org.a11y.atspi.Application' in ifaces
+    assert 'org.a11y.atspi.Component' in ifaces
+    assert 'org.a11y.atspi.Socket' in ifaces


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]