diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-04-19 00:08:35 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-04-19 00:49:29 (GMT) |
commit | 5c09309811c13fa360ba5e7b3173039da9c038f6 (patch) | |
tree | ef032cc4eb2b54e3ea0e7dec3c2085fd1fa08134 /tests/auto/qmediaserviceprovider | |
parent | fdb5a0fe7a465c0d193260eea94f7caf36263265 (diff) | |
download | Qt-5c09309811c13fa360ba5e7b3173039da9c038f6.zip Qt-5c09309811c13fa360ba5e7b3173039da9c038f6.tar.gz Qt-5c09309811c13fa360ba5e7b3173039da9c038f6.tar.bz2 |
Tests; Fix media tests, make sure they are using mediaservies.
Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'tests/auto/qmediaserviceprovider')
-rw-r--r-- | tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp b/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp index 06a8f60..64abedb 100644 --- a/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp +++ b/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp @@ -43,12 +43,12 @@ #include <QDebug> #include <QStringList> -#include <QtMultimedia/qmediaserviceprovider.h> -#include <QtMultimedia/qmediaserviceproviderplugin.h> -#include <QtMultimedia/private/qmediapluginloader_p.h> -#include <QtMultimedia/qmediaobject.h> -#include <QtMultimedia/qmediaservice.h> -#include <QtMultimedia/qmediaplayer.h> +#include <QtMediaServices/qmediaserviceprovider.h> +#include <QtMediaServices/qmediaserviceproviderplugin.h> +#include <QtMediaServices/private/qmediapluginloader_p.h> +#include <QtMediaServices/qmediaobject.h> +#include <QtMediaServices/qmediaservice.h> +#include <QtMediaServices/qmediaplayer.h> class MockMediaService : public QMediaService { @@ -88,16 +88,16 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { if (codecs.contains(QLatin1String("mpeg4"))) - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; if (mimeType == "audio/ogg") { - return QtMultimedia::ProbablySupported; + return QtMediaServices::ProbablySupported; } - return QtMultimedia::MaybeSupported; + return QtMediaServices::MaybeSupported; } QStringList supportedMimeTypes() const @@ -147,14 +147,14 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { Q_UNUSED(codecs); if (mimeType == "audio/wav") - return QtMultimedia::PreferredService; + return QtMediaServices::PreferredService; - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; } QStringList supportedMimeTypes() const @@ -239,15 +239,15 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { if (codecs.contains(QLatin1String("jpeg2000"))) - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; if (supportedMimeTypes().contains(mimeType)) - return QtMultimedia::ProbablySupported; + return QtMediaServices::ProbablySupported; - return QtMultimedia::MaybeSupported; + return QtMediaServices::MaybeSupported; } QStringList supportedMimeTypes() const @@ -334,7 +334,7 @@ void tst_QMediaServiceProvider::testHasSupport() { MockMediaServiceProvider mockProvider; QCOMPARE(mockProvider.hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); @@ -342,44 +342,44 @@ void tst_QMediaServiceProvider::testHasSupport() QSKIP("No default provider", SkipSingle); QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/ogg", QStringList()), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //while the service returns PreferredService, provider should return ProbablySupported QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/wav", QStringList()), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //even while all the plugins with "hasSupport" returned NotSupported, //MockServicePlugin3 has no "hasSupport" interface, so MaybeSupported QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/avi", QStringList() << "mpeg4"), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QCOMPARE(provider->hasSupport(QByteArray("non existing service"), "video/ogv", QStringList()), - QtMultimedia::NotSupported); + QtMediaServices::NotSupported); - QCOMPARE(QMediaPlayer::hasSupport("video/ogv"), QtMultimedia::MaybeSupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/ogg"), QtMultimedia::ProbablySupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/wav"), QtMultimedia::ProbablySupported); + QCOMPARE(QMediaPlayer::hasSupport("video/ogv"), QtMediaServices::MaybeSupported); + QCOMPARE(QMediaPlayer::hasSupport("audio/ogg"), QtMediaServices::ProbablySupported); + QCOMPARE(QMediaPlayer::hasSupport("audio/wav"), QtMediaServices::ProbablySupported); //test low latency flag support QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //plugin1 probably supports audio/ogg, it checked because it doesn't provide features iface QCOMPARE(QMediaPlayer::hasSupport("audio/ogg", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //Plugin4 is not checked here, sine it's known not support low latency QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); //test streaming flag support QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList(), QMediaPlayer::StreamPlayback), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //Plugin2 is not checked here, sine it's known not support streaming QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList(), QMediaPlayer::StreamPlayback), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); //ensure the correct media player plugin is choosen for mime type QMediaPlayer simplePlayer(0, QMediaPlayer::LowLatency); |