diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-03-19 04:25:45 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-03-19 05:32:17 (GMT) |
commit | ace866a969cd438b9f1dc11b7d40a99f53a13009 (patch) | |
tree | 723d5855bceb2d0b6aa755c7a85395b2db6292cd /tests/auto | |
parent | 0d4572595698502e04f491bfea3e16bb1851b645 (diff) | |
download | Qt-ace866a969cd438b9f1dc11b7d40a99f53a13009.zip Qt-ace866a969cd438b9f1dc11b7d40a99f53a13009.tar.gz Qt-ace866a969cd438b9f1dc11b7d40a99f53a13009.tar.bz2 |
Add autoLoad property to multimedia declarative elements.
Task-number: QTBUG-8947
Reviewed-by: Andrew den Exter
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp b/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp index a604854..a215bd5 100644 --- a/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp +++ b/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp @@ -61,6 +61,7 @@ private slots: void nullService(); void source(); + void autoLoad(); void playing(); void paused(); void duration(); @@ -430,6 +431,33 @@ void tst_QmlAudio::source() QCOMPARE(spy.count(), 3); } +void tst_QmlAudio::autoLoad() +{ + QtTestMediaServiceProvider provider; + QDeclarativeAudio audio; + audio.componentComplete(); + + QSignalSpy spy(&audio, SIGNAL(autoLoadChanged())); + + QCOMPARE(audio.isAutoLoad(), true); + + audio.setAutoLoad(false); + QCOMPARE(audio.isAutoLoad(), false); + QCOMPARE(spy.count(), 1); + + audio.setSource(QUrl("http://example.com")); + QCOMPARE(audio.source(), QUrl("http://example.com")); + audio.play(); + QCOMPARE(audio.isPlaying(), true); + audio.stop(); + + audio.setAutoLoad(true); + audio.setSource(QUrl("http://example.com")); + audio.setPaused(true); + QCOMPARE(spy.count(), 2); + QCOMPARE(audio.isPaused(), true); +} + void tst_QmlAudio::playing() { QtTestMediaServiceProvider provider; |