summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-08-03 15:41:30 +0200
committerChristian Stromme <christian.stromme@qt.io>2017-04-20 19:38:33 +0000
commit6b20032d91067e06f6ab5d4acf553812134236c7 (patch)
treeb7dbee742d533c3367cc1a60d674037ce580dba0
parent4736c9b04c9692a20fac520214d8076b4574ef71 (diff)
Improve tst_QMediaPlayerBackend::playPauseStop()v5.9.0-beta3
Check that the position doesn't change after calling pause(). Change-Id: I4d7629c2f9cb165134279e1cc7047a5c82f394c9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index 9aad6dd8..fb72a239 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -382,7 +382,9 @@ void tst_QMediaPlayerBackend::playPauseStop()
stateSpy.clear();
statusSpy.clear();
+ positionSpy.clear();
+ qint64 positionBeforePause = player.position();
player.pause();
QCOMPARE(player.state(), QMediaPlayer::PausedState);
@@ -391,6 +393,11 @@ void tst_QMediaPlayerBackend::playPauseStop()
QCOMPARE(stateSpy.count(), 1);
QCOMPARE(stateSpy.last()[0].value<QMediaPlayer::State>(), QMediaPlayer::PausedState);
+ QTest::qWait(2000);
+
+ QVERIFY(qAbs(player.position() - positionBeforePause) < 100);
+ QCOMPARE(positionSpy.count(), 0);
+
stateSpy.clear();
statusSpy.clear();