diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-07-28 16:12:10 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-08-02 08:58:38 (GMT) |
commit | 2e0a41f304e7505602699c9623a96b6174165150 (patch) | |
tree | 41df66c973facd80d899f35278bead513053eb17 /tests/auto | |
parent | 4cf313be8d440e2ef9bdb4a586fbcba20c3ee317 (diff) | |
download | Qt-2e0a41f304e7505602699c9623a96b6174165150.zip Qt-2e0a41f304e7505602699c9623a96b6174165150.tar.gz Qt-2e0a41f304e7505602699c9623a96b6174165150.tar.bz2 |
Updated tst_mediaobject resource playback test cases
* Removed Q_SKIP on Symbian
* Divided test into two, to exercise the two possible ways of providing
the resource path to Phonon::MediaSource
Task-number: QTBUG-6562
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/mediaobject/tst_mediaobject.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index 994057b..99a16db 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -124,7 +124,8 @@ class tst_MediaObject : public QObject void init(); void cleanup(); - void testPlayFromResource(); + void testPlayFromResourceDirect(); + void testPlayFromResourceFile(); void testPlayIllegalFile(); void initTestCase(); void checkForDefaults(); @@ -199,11 +200,22 @@ void tst_MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstat QWARN(QByteArray(QByteArray(QTest::toString(oldstate)) + " to " + QByteArray(QTest::toString(newstate)))); } -void tst_MediaObject::testPlayFromResource() +void tst_MediaObject::testPlayFromResourceDirect() +{ + MediaObject media; + media.setCurrentSource(Phonon::MediaSource(MEDIA_FILEPATH)); + QVERIFY(media.state() != Phonon::ErrorState); + if (media.state() != Phonon::StoppedState) + QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000); + QCOMPARE(media.state(), Phonon::StoppedState); + media.play(); + if (media.state() != Phonon::PlayingState) + QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000); + QCOMPARE(media.state(), Phonon::PlayingState); +} + +void tst_MediaObject::testPlayFromResourceFile() { -#ifdef Q_OS_SYMBIAN - QSKIP("Not implemented yet.", SkipAll); -#else QFile file(MEDIA_FILEPATH); MediaObject media; media.setCurrentSource(&file); @@ -215,7 +227,6 @@ void tst_MediaObject::testPlayFromResource() if (media.state() != Phonon::PlayingState) QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000); QCOMPARE(media.state(), Phonon::PlayingState); -#endif } void tst_MediaObject::testPlayIllegalFile() |