From e3b7957d6552e88aa23bd0ecc474db5f14981707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 6 Apr 2017 17:18:14 +0200 Subject: Fix time-stamp tests in tst_qmediaplayerbackend Not all backends supports or have an implementation that sets the time-stamp on the video frames, so check if we do have valid time-stamps before running any tests that depends on it. Change-Id: I53926022a02cd87d23c493f7b392c4eb4c45a55e Reviewed-by: Eirik Aavitsland --- .../auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index e60ea2cd7..7366ea200 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -749,6 +749,10 @@ void tst_QMediaPlayerBackend::seekPauseSeek() QTRY_COMPARE(player.state(), QMediaPlayer::PausedState); // it might take some time for the operation to be completed QTRY_VERIFY(!surface->m_frameList.isEmpty()); // we must see a frame at position 7000 here + // Make sure that the frame has a timestamp before testing - not all backends provides this + if (surface->m_frameList.back().startTime() < 0) + QSKIP("No timestamp"); + { QVideoFrame frame = surface->m_frameList.back(); const qint64 elapsed = (frame.startTime() / 1000) - position; // frame.startTime() is microsecond, position is milliseconds. -- cgit v1.2.3