Fix phonon test
Now it checks for ogg backend before playing. The timeout was moved
to 10s to avoid phonon timeout.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Renato Araújo <renato.araujo@openbossa.org>
This commit is contained in:
parent
6b70a1362c
commit
e34105a749
2 changed files with 9 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
set(PYSIDE_TIMEOUT 5)
|
set(PYSIDE_TIMEOUT 10)
|
||||||
|
|
||||||
macro(TEST_QT_MODULE var name)
|
macro(TEST_QT_MODULE var name)
|
||||||
if(NOT DISABLE_${name} AND ${var})
|
if(NOT DISABLE_${name} AND ${var})
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,17 @@ class TestSimplePlaying(UsesQCoreApplication):
|
||||||
self.called = True
|
self.called = True
|
||||||
|
|
||||||
def testStateChanged(self):
|
def testStateChanged(self):
|
||||||
QtCore.QObject.connect(self.media,
|
# Check for ogg support before playing it
|
||||||
|
if (phonon.Phonon.BackendCapabilities.isMimeTypeAvailable('audio/ogg')):
|
||||||
|
QtCore.QObject.connect(self.media,
|
||||||
QtCore.SIGNAL('stateChanged(Phonon::State, Phonon::State)'),
|
QtCore.SIGNAL('stateChanged(Phonon::State, Phonon::State)'),
|
||||||
self.state_cb)
|
self.state_cb)
|
||||||
|
|
||||||
self.media.play()
|
self.media.play()
|
||||||
self.app.exec_()
|
self.app.exec_()
|
||||||
self.assert_(self.called)
|
self.assert_(self.called)
|
||||||
|
else:
|
||||||
|
print 'Ogg format not supported! Playback test skipped!'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue