diff options
author | Tim Blechmann <tim@klingt.org> | 2024-04-22 09:16:17 +0800 |
---|---|---|
committer | Tim Blechmann <tim@klingt.org> | 2024-04-24 09:54:31 +0800 |
commit | 3e1bc1b76dae91d957fd1a1861d62ec79ca0a0db (patch) | |
tree | 1a76c7a877ef5ac5b1e42caf32db73036ed36224 | |
parent | ffc6dda55193d2cab8f2ea471198508ee56eb61d (diff) |
Tests: QMediaPlayer - fix playFromBuffer
`m_localVideoFile->toLocalFile()` didn't result in an QUrl that QFile
could load, causing the playFromBuffer test to be skipped.
So we need to build an url by hand.
Pick-to: 6.5 6.7
Change-Id: I8ba1d7e39613aa8c20aaabe55650587e2ff7694a
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
-rw-r--r-- | tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index fa1450571..dd404d345 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -37,6 +37,8 @@ QT_USE_NAMESPACE +using namespace Qt::Literals; + namespace { static qreal colorDifference(QRgb first, QRgb second) { @@ -2284,9 +2286,9 @@ void tst_QMediaPlayerBackend::playFromBuffer() TestVideoSink surface(false); QMediaPlayer player; player.setVideoOutput(&surface); - QFile file(m_localVideoFile->toLocalFile()); - if (!file.open(QIODevice::ReadOnly)) - QSKIP("Could not open file"); + QFile file(u":"_s + m_localVideoFile->toEncoded(QUrl::RemoveScheme)); + QVERIFY(file.open(QIODevice::ReadOnly)); + player.setSourceDevice(&file, *m_localVideoFile); player.play(); QTRY_VERIFY(player.position() >= 1000); |