From e34105a7499fe1c2edd6fbee6dc2acb3993f5827 Mon Sep 17 00:00:00 2001 From: Luciano Wolf Date: Thu, 17 Jun 2010 16:07:15 -0300 Subject: Fix phonon test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now it checks for ogg backend before playing. The timeout was moved to 10s to avoid phonon timeout. Reviewer: Marcelo Lira Renato Araújo --- tests/CMakeLists.txt | 2 +- tests/phonon/basic_playing_test.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7938ea7a4..c1a03764d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PYSIDE_TIMEOUT 5) +set(PYSIDE_TIMEOUT 10) macro(TEST_QT_MODULE var name) if(NOT DISABLE_${name} AND ${var}) diff --git a/tests/phonon/basic_playing_test.py b/tests/phonon/basic_playing_test.py index fe295e898..45f6c127b 100644 --- a/tests/phonon/basic_playing_test.py +++ b/tests/phonon/basic_playing_test.py @@ -54,13 +54,17 @@ class TestSimplePlaying(UsesQCoreApplication): self.called = True 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)'), self.state_cb) - self.media.play() - self.app.exec_() - self.assert_(self.called) + self.media.play() + self.app.exec_() + self.assert_(self.called) + else: + print 'Ogg format not supported! Playback test skipped!' if __name__ == '__main__': unittest.main() -- cgit v1.2.3