get_children_by_type() crashes

Bug #1091568 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopilot-gtk
Fix Released
Undecided
Unassigned

Bug Description

I am evaluating autopilot for GTK programs (so this might be an autopilot-gtk bug). I have this simple test:

$ cat autopilot_tests/test_evince.py
from autopilot.testcase import AutopilotTestCase
from autopilot.introspection.gtk import GtkIntrospectionTestMixin

class Evince(AutopilotTestCase, GtkIntrospectionTestMixin):
    def setUp(self):
        super(Evince, self).setUp()
        self.application = self.launch_test_application('evince')

    def test_children(self):
        print '---- children ----'
        print self.application.get_children()
        print '---- child 0 ----'
        print dir(self.application.get_children()[0])

        # crashes:
        print '---- EvWindow children ----'
        print self.application.get_children_by_type('EvWindow')
-------------------------- 8< -----------------------

The last line causes the Evince window to crash/hang; I get two metric tons of

** (evince:27302): WARNING **: unsupported type: GtkContainer

for every Gtk data type, and at the end

Traceback (most recent call last):
  File "/home/martin/ubuntu/tmp/autopilot_tests/test_evince.py", line 20, in test_open
    print self.application.get_children_by_type('EvWindow')
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 210, in get_children_by_type
    instances = self.get_children()
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 240, in get_children
    state_dicts = self.get_state_by_path(query)
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 299, in get_state_by_path
    ).GetState(piece)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)

(complete output is in attachment).

However, this seems to work:

        print self.application.select_single('EvWindow')

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in current trunk (and in the autolanding in saucy).

Changed in autopilot-gtk:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.