Updated integration test to check initial volume.
authorLev Zelenskiy <lev.zelenskiy@nokia.com>
Wed, 4 Apr 2012 03:58:55 +0000 (13:58 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 5 Apr 2012 03:52:21 +0000 (05:52 +0200)
Change-Id: Ida1eb24a6e09d31048722299104616fbaa26dffa
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp

index 6be141c..3dcbed3 100644 (file)
@@ -77,6 +77,7 @@ private slots:
     void volumeAndMuted();
     void volumeAcrossFiles_data();
     void volumeAcrossFiles();
+    void initialVolume();
     void seekPauseSeek();
     void probes();
     void playlist();
@@ -535,6 +536,28 @@ void tst_QMediaPlayerBackend::volumeAcrossFiles()
     QCOMPARE(player.isMuted(), muted);
 }
 
+void tst_QMediaPlayerBackend::initialVolume()
+{
+    {
+        QMediaPlayer player;
+        player.setVolume(1);
+        player.setMedia(localWavFile);
+        QCOMPARE(player.volume(), 1);
+        player.play();
+        QTRY_COMPARE(player.mediaStatus(), QMediaPlayer::EndOfMedia);
+        QCOMPARE(player.volume(), 1);
+    }
+
+    {
+        QMediaPlayer player;
+        player.setMedia(localWavFile);
+        QCOMPARE(player.volume(), 100);
+        player.play();
+        QTRY_COMPARE(player.mediaStatus(), QMediaPlayer::EndOfMedia);
+        QCOMPARE(player.volume(), 100);
+    }
+}
+
 void tst_QMediaPlayerBackend::seekPauseSeek()
 {
     if (localVideoFile.isNull())