aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-08-27 16:26:06 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-08-27 16:26:06 +0200
commitf2b47b88f70990bf76fe83d45b64477b4db4dffc (patch)
tree60cb34d89910565ae0b38d8c5558192c720b5e47
parent8c8e6d342f5234b93c57a7576b50303ed4938317 (diff)
downloadayatana-indicator-messages-f2b47b88f70990bf76fe83d45b64477b4db4dffc.tar.gz
ayatana-indicator-messages-f2b47b88f70990bf76fe83d45b64477b4db4dffc.tar.bz2
ayatana-indicator-messages-f2b47b88f70990bf76fe83d45b64477b4db4dffc.zip
test-client.py: flush GDBusConnection before (potentially) freeing it
-rwxr-xr-xtest/test-client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test-client.py b/test/test-client.py
index a1d503f..0dbf868 100755
--- a/test/test-client.py
+++ b/test/test-client.py
@@ -63,6 +63,11 @@ class MessagingMenuTest(dbusmock.DBusTestCase):
self.assertMethodCalled('UnregisterApplication', 'test.desktop')
# ApplicationStoppedRunning is called when the last ref on mmapp is dropped
+ # Since mmapp is the only thing holding on to a GDBusConnection, the
+ # connection might get freed before it sends the StoppedRunning
+ # message. Flush the connection to make sure it is sent.
+ bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
+ bus.flush_sync(None)
del mmapp
self.assertMethodCalled('ApplicationStoppedRunning', 'test.desktop')