summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2021-05-23 17:40:22 +0200
committerLars Knoll <lars.knoll@qt.io>2021-05-25 06:10:02 +0000
commit454ce528541989e9116df1b7aff49085b5a37274 (patch)
tree5f110200ac87bceb2d8a7e0ee622702c10ca5307 /tests
parent6bbbd6754de580c67839257e0e98f51ac676b571 (diff)
Fix the remaining failures for tst_qmediaplayerbackend in macOS
Use QTimer to update playback position, fix a crash, and use QTRY_COMPARE when testing the player position. Change-Id: I44840eefb6f90ffc04084fe2743238400ee7a73e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index 2a91da3d4..5200edb40 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -383,7 +383,7 @@ void tst_QMediaPlayerBackend::playPauseStop()
QCOMPARE(statusSpy.last()[0].value<QMediaPlayer::MediaStatus>(), QMediaPlayer::LoadedMedia);
//ensure the position is reset to 0 at stop and positionChanged(0) is emitted
- QCOMPARE(player.position(), qint64(0));
+ QTRY_COMPARE(player.position(), qint64(0));
QCOMPARE(positionSpy.last()[0].value<qint64>(), qint64(0));
QVERIFY(player.duration() > 0);
@@ -850,7 +850,7 @@ void tst_QMediaPlayerBackend::seekInStoppedState()
player.stop();
QCOMPARE(player.playbackState(), QMediaPlayer::StoppedState);
QTRY_COMPARE(player.mediaStatus(), QMediaPlayer::LoadedMedia);
- QCOMPARE(player.position(), 0);
+ QTRY_COMPARE(player.position(), 0);
stateSpy.clear();
positionSpy.clear();