summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2005-11-15 15:35:44 +0000
committerEdward Hervey <bilboed@bilboed.com>2005-11-15 15:35:44 +0000
commit53f9716a258ef4e37c7d6413db5c0cf5118b0f0b (patch)
tree34eb07a617489d98e17b053368e91e2ac0839e9e /testsuite
parentca54d806ebeaa79bc1b72318e2dae79430c67576 (diff)
gst/gst.defs: Keep refcount for the message of gst_bus_post()
Original commit message from CVS: * gst/gst.defs: Keep refcount for the message of gst_bus_post() * gst/gststructure.override: Don't free a structure on dealloc (the parent does that) * testsuite/test_message.py: Proper testing of bus functionnality with a mainloop
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/test_message.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/testsuite/test_message.py b/testsuite/test_message.py
index 48042ee..a9fb5f0 100644
--- a/testsuite/test_message.py
+++ b/testsuite/test_message.py
@@ -30,20 +30,26 @@ class NewTest(TestCase):
m = gst.message_new_eos(b)
gst.info("got message : %s" % m)
- def _testApplication(self):
+ def message_application_cb(self, bus, message):
+ print "got message"
+ self.got_message = True
+ self.loop.quit()
+
+ def testApplication(self):
+ self.loop = gobject.MainLoop()
gst.info("creating new pipeline")
bin = gst.Pipeline()
bus = bin.get_bus()
bus.add_signal_watch()
- got_message = False
- def message_application_cb(bus, message):
- got_message = True
- bus.connect('message::application', message_application_cb)
+ self.got_message = False
+ bus.connect('message::application', self.message_application_cb)
- gst.info("creating new application message from that bin")
- msg = gst.message_new_application(bin, gst.Structure('foo'))
+ struc = gst.Structure("foo")
+ msg = gst.message_new_application(bin, struc)
bus.post(msg)
- self.failUnless(got_message == True)
+ self.loop.run()
+ bus.remove_signal_watch()
+ self.failUnless(self.got_message == True)
self.gccollect()
if __name__ == "__main__":