diff options
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; |