summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-04-13 16:51:31 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-04-15 05:39:41 (GMT)
commit0d12963c85fc116cd7283cd16ca0524f086f9d09 (patch)
tree22a71948071ff9a6671af21023ffcff52f975676 /tests
parent57dddfe5036e256a9d2648c85fadb5abef31fb19 (diff)
downloadQt-0d12963c85fc116cd7283cd16ca0524f086f9d09.zip
Qt-0d12963c85fc116cd7283cd16ca0524f086f9d09.tar.gz
Qt-0d12963c85fc116cd7283cd16ca0524f086f9d09.tar.bz2
tst_mediaobject: Ensure playSDP step cleanup is run
This step previously did not guarantee that the m_media object would be left in StoppedState, which in turn meant that following test steps could fail. Task-number: QTBUG-9339 Reviewed-by: Frans Englich
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/mediaobject/tst_mediaobject.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index efb9132..7f9f57d 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -572,13 +572,18 @@ void tst_MediaObject::playSDP()
if (m_media->state() != Phonon::StoppedState)
QTest::waitForSignal(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000);
- // At this point we're in error state due to absent media, but it has now loaded the SDP:
- QCOMPARE(m_media->errorString(), QString::fromLatin1("Buffering clip failed: Unknown error (-39)"));
+ // MediaObject should have loaded the SDP, but be in error state due to absent media
+ const bool stateMatch = (m_media->state() == Phonon::ErrorState);
+ const bool errorStringMatch = (m_media->errorString() == QString::fromLatin1("Buffering clip failed: Unknown error (-39)"));
- // We cannot play the SDP, we can neither attempt to play it, because we
- // won't get a state change from ErrorState to ErrorState, and hence block
- // on a never occuring signal.
+ // Ensure that m_media is back in ground state prior to starting next test step
m_media->setCurrentSource(oldSource);
+ if (m_media->state() != Phonon::StoppedState)
+ QTest::waitForSignal(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)));
+ QCOMPARE(m_media->state(), Phonon::StoppedState);
+
+ QVERIFY(stateMatch);
+ QVERIFY(errorStringMatch);
#else
QSKIP("Unsupported on this platform.", SkipAll);