summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-03-19 04:25:45 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-03-19 05:32:17 (GMT)
commitace866a969cd438b9f1dc11b7d40a99f53a13009 (patch)
tree723d5855bceb2d0b6aa755c7a85395b2db6292cd /tests/auto
parent0d4572595698502e04f491bfea3e16bb1851b645 (diff)
downloadQt-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.cpp28
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;