diff options
Diffstat (limited to 'tests/auto/mediaobject/tst_mediaobject.cpp')
-rw-r--r-- | tests/auto/mediaobject/tst_mediaobject.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index 96589b7..1b113b2 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -349,6 +349,18 @@ void tst_MediaObject::_pausePlayback() void tst_MediaObject::initTestCase() { QCoreApplication::setApplicationName("tst_MediaObject"); + m_stateChangedSignalSpy = 0; + m_media = 0; + +#ifdef Q_OS_WINCE + QString pluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath); +#ifdef DEBUG + QVERIFY(QFile::exists(pluginsPath + "/phonon_backend/phonon_waveoutd4.dll") || QFile::exists(pluginsPath + "/phonon_backend/phonon_phonon_ds9d4.dll")); +#else + QVERIFY(QFile::exists(pluginsPath + "/phonon_backend/phonon_waveout4.dll") || QFile::exists(pluginsPath + "/phonon_backend/phonon_phonon_ds94.dll")); +#endif +#endif + m_url = qgetenv("PHONON_TESTURL"); m_media = new MediaObject(this); @@ -787,7 +799,7 @@ void tst_MediaObject::setMediaAndPlay() QSignalSpy totalTimeChangedSignalSpy(m_media, SIGNAL(totalTimeChanged(qint64))); QVERIFY(m_media->currentSource().type() != MediaSource::Invalid); Phonon::State state = m_media->state(); - QVERIFY(state == Phonon::StoppedState || state == Phonon::PlayingState); + QVERIFY(state == Phonon::StoppedState || state == Phonon::PlayingState || Phonon::PausedState); m_media->setCurrentSource(m_url); // before calling play() we better make sure that if play() finishes very fast that we don't get // called again @@ -856,8 +868,10 @@ void tst_MediaObject::testPlayBeforeFinish() void tst_MediaObject::cleanupTestCase() { - delete m_stateChangedSignalSpy; - delete m_media; + if (m_stateChangedSignalSpy) + delete m_stateChangedSignalSpy; + if (m_media) + delete m_media; #ifdef Q_OS_WINCE QTest::qWait(200); #endif |