diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-17 10:48:30 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-17 10:48:30 +0200 |
commit | b4f2dc4f62b2cb4bd9c43de56bbfd0024404c190 (patch) | |
tree | b4a71b9a45b1c1c3adf21cdc49de68f9c86b1e9c /tests/auto/integration | |
parent | 393602150d1f3eec25252aa40045f9e24ae5329b (diff) | |
parent | 820205e604a5f281238c23464638fdff72b969d1 (diff) | |
download | qtmultimedia-b4f2dc4f62b2cb4bd9c43de56bbfd0024404c190.tar.gz |
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: Ib8d05d6e21c7beb19f618cd1edc52d248b1e43b8
Diffstat (limited to 'tests/auto/integration')
-rw-r--r-- | tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index dfa1bf254..1f1df9aac 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -331,6 +331,33 @@ void tst_QMediaPlayerBackend::playPauseStop() QSignalSpy stateSpy(&player, SIGNAL(stateChanged(QMediaPlayer::State))); QSignalSpy statusSpy(&player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); QSignalSpy positionSpy(&player, SIGNAL(positionChanged(qint64))); + QSignalSpy errorSpy(&player, SIGNAL(error(QMediaPlayer::Error))); + + // Check play() without a media + player.play(); + + QCOMPARE(player.state(), QMediaPlayer::StoppedState); + QCOMPARE(player.mediaStatus(), QMediaPlayer::NoMedia); + QCOMPARE(player.error(), QMediaPlayer::NoError); + QCOMPARE(player.position(), 0); + QCOMPARE(stateSpy.count(), 0); + QCOMPARE(statusSpy.count(), 0); + QCOMPARE(positionSpy.count(), 0); + QCOMPARE(errorSpy.count(), 0); + + // Check pause() without a media + player.pause(); + + QCOMPARE(player.state(), QMediaPlayer::StoppedState); + QCOMPARE(player.mediaStatus(), QMediaPlayer::NoMedia); + QCOMPARE(player.error(), QMediaPlayer::NoError); + QCOMPARE(player.position(), 0); + QCOMPARE(stateSpy.count(), 0); + QCOMPARE(statusSpy.count(), 0); + QCOMPARE(positionSpy.count(), 0); + QCOMPARE(errorSpy.count(), 0); + + // The rest is with a valid media player.setMedia(localWavFile); |