| 36 | self.loop.quit() |
| 37 | |
| 38 | def testApplication(self): |
| 39 | self.loop = gobject.MainLoop() |
| 40 | gst.info("creating new pipeline") |
| 41 | bin = gst.Pipeline() |
| 42 | bus = bin.get_bus() |
| 43 | bus.add_signal_watch() |
| 44 | self.got_message = False |
| 45 | bus.connect('message::application', self.message_application_cb) |
| 46 | |
| 47 | struc = gst.Structure("foo") |
| 48 | msg = gst.message_new_application(bin, struc) |
| 49 | # the bus is flushing in NULL, so we need to set the pipeline to READY |
| 50 | bin.set_state(gst.STATE_READY) |
| 51 | bus.post(msg) |
| 52 | self.loop.run() |
| 53 | bus.remove_signal_watch() |
| 54 | bin.set_state(gst.STATE_NULL) |
| 55 | self.failUnless(self.got_message == True) |
| 56 | self.gccollect() |
| 57 | |
| 58 | class TestCreateMessages(TestCase): |
| 59 | |