From 6b20032d91067e06f6ab5d4acf553812134236c7 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 3 Aug 2016 15:41:30 +0200 Subject: Improve tst_QMediaPlayerBackend::playPauseStop() Check that the position doesn't change after calling pause(). Change-Id: I4d7629c2f9cb165134279e1cc7047a5c82f394c9 Reviewed-by: Eirik Aavitsland Reviewed-by: Christian Stromme --- .../integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 9aad6dd80..fb72a239c 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::PausedState); + QTest::qWait(2000); + + QVERIFY(qAbs(player.position() - positionBeforePause) < 100); + QCOMPARE(positionSpy.count(), 0); + stateSpy.clear(); statusSpy.clear(); -- cgit v1.2.3