diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-01-19 17:52:51 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-01-29 08:47:04 +0000 |
commit | c0bf3323d28def5be95ba28f7a2bb5efab78af73 (patch) | |
tree | e24f34799d5216039c1517752f4516e06a87d650 /tests | |
parent | efc1d31a228a8f3466e5e9e9ff1154fd41c7a7f3 (diff) |
Get rid of the qmediaserviceprovider autotest
This class is scheduled to die soon anyway.
Change-Id: I888547252dcd9a1f07d10c121b3d5afd07f15076
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
28 files changed, 0 insertions, 1086 deletions
diff --git a/tests/auto/unit/CMakeLists.txt b/tests/auto/unit/CMakeLists.txt index 7c9118540..e27072440 100644 --- a/tests/auto/unit/CMakeLists.txt +++ b/tests/auto/unit/CMakeLists.txt @@ -18,7 +18,6 @@ add_subdirectory(qmediaplaylist) add_subdirectory(qmediapluginloader) add_subdirectory(qmediarecorder) add_subdirectory(qmediaservice) -add_subdirectory(qmediaserviceprovider) add_subdirectory(qmediatimerange) add_subdirectory(qmetadatareadercontrol) add_subdirectory(qmetadatawritercontrol) diff --git a/tests/auto/unit/multimedia.pro b/tests/auto/unit/multimedia.pro index 05d612c03..d6c826436 100644 --- a/tests/auto/unit/multimedia.pro +++ b/tests/auto/unit/multimedia.pro @@ -17,7 +17,6 @@ SUBDIRS += \ qmediapluginloader \ qmediarecorder \ qmediaservice \ - qmediaserviceprovider \ qmediatimerange \ qmetadatareadercontrol \ qmetadatawritercontrol \ diff --git a/tests/auto/unit/qmediaserviceprovider/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/CMakeLists.txt deleted file mode 100644 index 9c1b93fe5..000000000 --- a/tests/auto/unit/qmediaserviceprovider/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from qmediaserviceprovider.pro. - -add_subdirectory(mockserviceplugin1) -add_subdirectory(mockserviceplugin2) -add_subdirectory(mockserviceplugin3) -add_subdirectory(mockserviceplugin4) -add_subdirectory(mockserviceplugin5) -add_subdirectory(test) diff --git a/tests/auto/unit/qmediaserviceprovider/mockservice.h b/tests/auto/unit/qmediaserviceprovider/mockservice.h deleted file mode 100644 index 7d5173b06..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockservice.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MOCKSERVICE_H -#define MOCKSERVICE_H - -#include <qmediaservice.h> - -class MockMediaService : public QMediaService -{ - Q_OBJECT -public: - MockMediaService(const QString& name, QObject *parent = 0) : QMediaService(parent) - { setObjectName(name); } - ~MockMediaService() {} - - QObject *requestControl(const char *) {return 0;} - void releaseControl(QObject *) {} -}; - -#endif // MOCKSERVICE_H diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/CMakeLists.txt deleted file mode 100644 index 178ec01eb..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from mockserviceplugin1.pro. - -##################################################################### -## MockServicePlugin1 Plugin: -##################################################################### - -qt_internal_add_plugin(MockServicePlugin1 - OUTPUT_NAME mockserviceplugin1 - TYPE mediaservice - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../$${PLUGIN_TYPE}" - SOURCES - ../mockservice.h - mockserviceplugin1.cpp - DEFINES - QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::MultimediaPrivate -) - -#### Keys ignored in scope 1:.:.:mockserviceplugin1.pro:<TRUE>: -# OTHER_FILES = "mockserviceplugin1.json" -# target.path = "$$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE}" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:.:mockserviceplugin1.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# DESTDIR = "../debug/$${PLUGIN_TYPE}" - -#### Keys ignored in scope 4:.:.:mockserviceplugin1.pro:else: -# DESTDIR = "../release/$${PLUGIN_TYPE}" diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.cpp deleted file mode 100644 index fd920ce73..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmediaserviceproviderplugin.h> -#include <qmediaservice.h> -#include "../mockservice.h" - -class MockServicePlugin1 : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedFormatsInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedFormatsInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin1.json") -public: - [[nodiscard]] QStringList keys() const - { - return QStringList() << - QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER); - } - - QMediaService* create(QString const& key) override - { - if (keys().contains(key)) - return new MockMediaService("MockServicePlugin1"); - - return nullptr; - } - - void release(QMediaService *service) override - { - delete service; - } - - [[nodiscard]] QMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const override - { - if (codecs.contains(QLatin1String("mpeg4"))) - return QMultimedia::NotSupported; - - if (mimeType == "audio/ogg") { - return QMultimedia::ProbablySupported; - } - - return QMultimedia::MaybeSupported; - } - - [[nodiscard]] QStringList supportedMimeTypes() const override - { - return QStringList("audio/ogg"); - } -}; - -#include "mockserviceplugin1.moc" - diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.json deleted file mode 100644 index 69ff56452..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["mockserviceplugin1"], - "Services": ["org.qt-project.qt.mediaplayer"] -} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro deleted file mode 100644 index 813d102cb..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += multimedia-private - -HEADERS += ../mockservice.h -SOURCES += mockserviceplugin1.cpp -OTHER_FILES += mockserviceplugin1.json - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = MockServicePlugin1 -load(qt_plugin) - -DESTDIR = ../$${PLUGIN_TYPE} -win32:debug_and_release { - CONFIG(debug, debug|release) { - DESTDIR = ../debug/$${PLUGIN_TYPE} - } else { - DESTDIR = ../release/$${PLUGIN_TYPE} - } -} - -target.path = $$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/CMakeLists.txt deleted file mode 100644 index 6b14d892b..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from mockserviceplugin2.pro. - -##################################################################### -## MockServicePlugin2 Plugin: -##################################################################### - -qt_internal_add_plugin(MockServicePlugin2 - OUTPUT_NAME mockserviceplugin2 - TYPE mediaservice - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../$${PLUGIN_TYPE}" - SOURCES - ../mockservice.h - mockserviceplugin2.cpp - DEFINES - QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::MultimediaPrivate -) - -#### Keys ignored in scope 1:.:.:mockserviceplugin2.pro:<TRUE>: -# OTHER_FILES = "mockserviceplugin2.json" -# target.path = "$$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE}" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:.:mockserviceplugin2.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# DESTDIR = "../debug/$${PLUGIN_TYPE}" - -#### Keys ignored in scope 4:.:.:mockserviceplugin2.pro:else: -# DESTDIR = "../release/$${PLUGIN_TYPE}" diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp deleted file mode 100644 index 89a14f82c..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmediaserviceproviderplugin.h> -#include <qmediaservice.h> -#include "../mockservice.h" - -class MockServicePlugin2 : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedFormatsInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedFormatsInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin2.json") -public: - [[nodiscard]] QStringList keys() const - { - return QStringList() << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER); - } - - QMediaService* create(QString const& key) override - { - if (keys().contains(key)) - return new MockMediaService("MockServicePlugin2"); - - return nullptr; - } - - void release(QMediaService *service) override - { - delete service; - } - - [[nodiscard]] QMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const override - { - Q_UNUSED(codecs); - - if (mimeType == "audio/wav") - return QMultimedia::PreferredService; - - return QMultimedia::NotSupported; - } - - [[nodiscard]] QStringList supportedMimeTypes() const override - { - return QStringList("audio/wav"); - } -}; - -#include "mockserviceplugin2.moc" - diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json deleted file mode 100644 index 07f9cae7a..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["mockserviceplugin2"], - "Services": ["org.qt-project.qt.mediaplayer"] -} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro deleted file mode 100644 index f2ac3291d..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += multimedia-private - -HEADERS += ../mockservice.h -SOURCES += mockserviceplugin2.cpp -OTHER_FILES += mockserviceplugin2.json - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = MockServicePlugin2 -load(qt_plugin) - -DESTDIR = ../$${PLUGIN_TYPE} -win32:debug_and_release { - CONFIG(debug, debug|release) { - DESTDIR = ../debug/$${PLUGIN_TYPE} - } else { - DESTDIR = ../release/$${PLUGIN_TYPE} - } -} - -target.path = $$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/CMakeLists.txt deleted file mode 100644 index 8424979d9..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from mockserviceplugin3.pro. - -##################################################################### -## MockServicePlugin3 Plugin: -##################################################################### - -qt_internal_add_plugin(MockServicePlugin3 - OUTPUT_NAME mockserviceplugin3 - TYPE mediaservice - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../$${PLUGIN_TYPE}" - SOURCES - ../mockservice.h - mockserviceplugin3.cpp - DEFINES - QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::MultimediaPrivate -) - -#### Keys ignored in scope 1:.:.:mockserviceplugin3.pro:<TRUE>: -# OTHER_FILES = "mockserviceplugin3.json" -# target.path = "$$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE}" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:.:mockserviceplugin3.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# DESTDIR = "../debug/$${PLUGIN_TYPE}" - -#### Keys ignored in scope 4:.:.:mockserviceplugin3.pro:else: -# DESTDIR = "../release/$${PLUGIN_TYPE}" diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp deleted file mode 100644 index 4c1978203..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmediaserviceproviderplugin.h> -#include <qmediaservice.h> -#include "../mockservice.h" - -class MockServicePlugin3 : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedDevicesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedDevicesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin3.json") -public: - [[nodiscard]] QStringList keys() const - { - return QStringList() << - QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER) << - QLatin1String(Q_MEDIASERVICE_AUDIOSOURCE) << - QLatin1String(Q_MEDIASERVICE_CAMERA); - } - - QMediaService* create(QString const& key) override - { - if (keys().contains(key)) - return new MockMediaService("MockServicePlugin3"); - - return nullptr; - } - - void release(QMediaService *service) override - { - delete service; - } - - [[nodiscard]] QByteArray defaultDevice(const QByteArray &service) const override - { - if (service == Q_MEDIASERVICE_AUDIOSOURCE) - return "audiosource1"; - - if (service == Q_MEDIASERVICE_CAMERA) - return "frontcamera"; - - return QByteArray(); - } - - [[nodiscard]] QList<QByteArray> devices(const QByteArray &service) const override - { - QList<QByteArray> res; - if (service == Q_MEDIASERVICE_AUDIOSOURCE) - res << "audiosource1" << "audiosource2"; - - if (service == Q_MEDIASERVICE_CAMERA) - res << "frontcamera"; - - return res; - } - - QString deviceDescription(const QByteArray &service, const QByteArray &device) override - { - if (devices(service).contains(device)) - return QString(device)+" description"; - - return QString(); - } -}; - -#include "mockserviceplugin3.moc" - diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.json deleted file mode 100644 index ab55b5d1d..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["mockserviceplugin3"], - "Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiosource", "org.qt-project.qt.camera"] -} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro deleted file mode 100644 index 51f87d9da..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += multimedia-private - -HEADERS += ../mockservice.h -SOURCES += mockserviceplugin3.cpp -OTHER_FILES += mockserviceplugin3.json - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = MockServicePlugin3 -load(qt_plugin) - -DESTDIR = ../$${PLUGIN_TYPE} -win32:debug_and_release { - CONFIG(debug, debug|release) { - DESTDIR = ../debug/$${PLUGIN_TYPE} - } else { - DESTDIR = ../release/$${PLUGIN_TYPE} - } -} - -target.path = $$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/CMakeLists.txt deleted file mode 100644 index 8a3ab1ae4..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from mockserviceplugin4.pro. - -##################################################################### -## MockServicePlugin4 Plugin: -##################################################################### - -qt_internal_add_plugin(MockServicePlugin4 - OUTPUT_NAME mockserviceplugin4 - TYPE mediaservice - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../$${PLUGIN_TYPE}" - SOURCES - ../mockservice.h - mockserviceplugin4.cpp - DEFINES - QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::MultimediaPrivate -) - -#### Keys ignored in scope 1:.:.:mockserviceplugin4.pro:<TRUE>: -# OTHER_FILES = "mockserviceplugin4.json" -# target.path = "$$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE}" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:.:mockserviceplugin4.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# DESTDIR = "../debug/$${PLUGIN_TYPE}" - -#### Keys ignored in scope 4:.:.:mockserviceplugin4.pro:else: -# DESTDIR = "../release/$${PLUGIN_TYPE}" diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.cpp deleted file mode 100644 index 4873b74e2..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmediaserviceproviderplugin.h> -#include <qmediaservice.h> -#include "../mockservice.h" - -class MockServicePlugin4 : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedFormatsInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedFormatsInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin4.json") -public: - [[nodiscard]] QStringList keys() const - { - return QStringList() << QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER); - } - - QMediaService* create(QString const& key) override - { - if (keys().contains(key)) - return new MockMediaService("MockServicePlugin4"); - - return nullptr; - } - - void release(QMediaService *service) override - { - delete service; - } - - [[nodiscard]] QMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const override - { - if (codecs.contains(QLatin1String("jpeg2000"))) - return QMultimedia::NotSupported; - - if (supportedMimeTypes().contains(mimeType)) - return QMultimedia::ProbablySupported; - - return QMultimedia::MaybeSupported; - } - - [[nodiscard]] QStringList supportedMimeTypes() const override - { - return QStringList() << "video/mp4" << "video/quicktime"; - } -}; - -#include "mockserviceplugin4.moc" - diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.json deleted file mode 100644 index d8b8bd7e9..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["mockserviceplugin4"], - "Services": ["org.qt-project.qt.mediaplayer"] -} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro deleted file mode 100644 index c3834ab03..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += multimedia-private - -HEADERS += ../mockservice.h -SOURCES += mockserviceplugin4.cpp -OTHER_FILES += mockserviceplugin4.json - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = MockServicePlugin4 -load(qt_plugin) - -DESTDIR = ../$${PLUGIN_TYPE} -win32:debug_and_release { - CONFIG(debug, debug|release) { - DESTDIR = ../debug/$${PLUGIN_TYPE} - } else { - DESTDIR = ../release/$${PLUGIN_TYPE} - } -} - -target.path = $$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/CMakeLists.txt deleted file mode 100644 index be0f18036..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from mockserviceplugin5.pro. - -##################################################################### -## MockServicePlugin5 Plugin: -##################################################################### - -qt_internal_add_plugin(MockServicePlugin5 - OUTPUT_NAME mockserviceplugin5 - TYPE mediaservice - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../$${PLUGIN_TYPE}" - SOURCES - ../mockservice.h - mockserviceplugin5.cpp - DEFINES - QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::MultimediaPrivate -) - -#### Keys ignored in scope 1:.:.:mockserviceplugin5.pro:<TRUE>: -# OTHER_FILES = "mockserviceplugin5.json" -# target.path = "$$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE}" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:.:mockserviceplugin5.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# DESTDIR = "../debug/$${PLUGIN_TYPE}" - -#### Keys ignored in scope 4:.:.:mockserviceplugin5.pro:else: -# DESTDIR = "../release/$${PLUGIN_TYPE}" diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp deleted file mode 100644 index 1fafb901a..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qmediaserviceproviderplugin.h> -#include <qmediaservice.h> -#include "../mockservice.h" - -class MockServicePlugin5 : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedDevicesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedDevicesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "mockserviceplugin5.json") -public: - [[nodiscard]] QStringList keys() const - { - return QStringList() << QLatin1String(Q_MEDIASERVICE_CAMERA); - } - - QMediaService* create(QString const& key) override - { - if (keys().contains(key)) - return new MockMediaService("MockServicePlugin5"); - - return nullptr; - } - - void release(QMediaService *service) override - { - delete service; - } - - [[nodiscard]] QByteArray defaultDevice(const QByteArray &service) const override - { - if (service == Q_MEDIASERVICE_CAMERA) - return "backcamera"; - - return QByteArray(); - } - - [[nodiscard]] QList<QByteArray> devices(const QByteArray &service) const override - { - QList<QByteArray> res; - if (service == Q_MEDIASERVICE_CAMERA) - res << "backcamera" << "somecamera"; - - return res; - } - - QString deviceDescription(const QByteArray &service, const QByteArray &device) override - { - if (devices(service).contains(device)) - return QString(device)+" description"; - - return QString(); - } -}; - -#include "mockserviceplugin5.moc" - diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.json b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.json deleted file mode 100644 index cc6f4816c..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["mockserviceplugin5"], - "Services": ["org.qt-project.qt.camera"] -} diff --git a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro b/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro deleted file mode 100644 index b273c6b15..000000000 --- a/tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro +++ /dev/null @@ -1,22 +0,0 @@ -QT += multimedia-private - -HEADERS += ../mockservice.h -SOURCES += mockserviceplugin5.cpp -OTHER_FILES += mockserviceplugin5.json - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = MockServicePlugin5 -load(qt_plugin) - -DESTDIR = ../$${PLUGIN_TYPE} -win32:debug_and_release { - CONFIG(debug, debug|release) { - DESTDIR = ../debug/$${PLUGIN_TYPE} - } else { - DESTDIR = ../release/$${PLUGIN_TYPE} - } -} - -target.path = $$[QT_INSTALL_TESTS]/tst_qmediaserviceprovider/$${PLUGIN_TYPE} diff --git a/tests/auto/unit/qmediaserviceprovider/qmediaserviceprovider.pro b/tests/auto/unit/qmediaserviceprovider/qmediaserviceprovider.pro deleted file mode 100644 index cea19e212..000000000 --- a/tests/auto/unit/qmediaserviceprovider/qmediaserviceprovider.pro +++ /dev/null @@ -1,14 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ORDERED - -SUBDIRS += \ - mockserviceplugin1 \ - mockserviceplugin2 \ - mockserviceplugin3 \ - mockserviceplugin4 \ - mockserviceplugin5 \ - test - -# no special install rule for subdir -INSTALLS = - diff --git a/tests/auto/unit/qmediaserviceprovider/test/CMakeLists.txt b/tests/auto/unit/qmediaserviceprovider/test/CMakeLists.txt deleted file mode 100644 index bd74ed453..000000000 --- a/tests/auto/unit/qmediaserviceprovider/test/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from test.pro. - -##################################################################### -## tst_qmediaserviceprovider Test: -##################################################################### - -qt_add_test(tst_qmediaserviceprovider - OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" - SOURCES - ../tst_qmediaserviceprovider.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::MultimediaPrivate -) - -## Scopes: -##################################################################### diff --git a/tests/auto/unit/qmediaserviceprovider/test/test.pro b/tests/auto/unit/qmediaserviceprovider/test/test.pro deleted file mode 100644 index 94f7f259a..000000000 --- a/tests/auto/unit/qmediaserviceprovider/test/test.pro +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG += testcase -TARGET = ../tst_qmediaserviceprovider - -QT += multimedia-private testlib - -SOURCES += ../tst_qmediaserviceprovider.cpp - -win32:debug_and_release { - CONFIG(debug, debug|release) { - TARGET = ../../debug/tst_qmediaserviceprovider - } else { - TARGET = ../../release/tst_qmediaserviceprovider - } -} - -mac: CONFIG -= app_bundle - diff --git a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp b/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp deleted file mode 100644 index a46929238..000000000 --- a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//TESTED_COMPONENT=src/multimedia - -#include <QtTest/QtTest> -#include <QDebug> -#include <QStringList> - -#include <private/qmediaserviceprovider_p.h> -#include <qmediaserviceproviderplugin.h> -#include <qmediasource.h> -#include <qmediaservice.h> -#include <qmediaplayer.h> -#include <qmediarecorder.h> -#include <qcamera.h> -#include <qcamerainfo.h> -#include <qmediadevicemanager.h> - -QT_USE_NAMESPACE - -class MockMediaServiceProvider : public QMediaServiceProvider -{ - QMediaService* requestService(const QByteArray &type) override - { - Q_UNUSED(type); - return nullptr; - } - - void releaseService(QMediaService *service) override - { - Q_UNUSED(service); - } -}; - - -class tst_QMediaServiceProvider : public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - -private slots: - void testDefaultProviderAvailable(); - void testObtainService(); - void testHasSupport(); - void testSupportedMimeTypes(); - void testDefaultDevice(); - void testAvailableDevices(); - void testCameraInfo(); - -private: - QObjectList plugins; -}; - -void tst_QMediaServiceProvider::initTestCase() -{ -// QMediaPluginLoader::setStaticPlugins(QLatin1String("mediaservice"), plugins); -#if QT_CONFIG(library) - QCoreApplication::setLibraryPaths(QStringList() << QCoreApplication::applicationDirPath()); -#endif -} - -void tst_QMediaServiceProvider::testDefaultProviderAvailable() -{ - // Must always be a default provider available - QVERIFY(QMediaServiceProvider::defaultServiceProvider() != nullptr); -} - -void tst_QMediaServiceProvider::testObtainService() -{ - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QMediaService *service = nullptr; - - // Player - service = provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER); - QVERIFY(service != nullptr); - provider->releaseService(service); -} - -void tst_QMediaServiceProvider::testHasSupport() -{ - MockMediaServiceProvider mockProvider; - QCOMPARE(mockProvider.hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QMultimedia::MaybeSupported); - - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QMultimedia::MaybeSupported); - - QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/ogg", QStringList()), - QMultimedia::ProbablySupported); - - //while the service returns PreferredService, provider should return ProbablySupported - QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/wav", QStringList()), - QMultimedia::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"), - QMultimedia::MaybeSupported); - - QCOMPARE(provider->hasSupport(QByteArray("non existing service"), "video/ogv", QStringList()), - QMultimedia::NotSupported); - - QCOMPARE(QMediaPlayer::hasSupport("video/ogv"), QMultimedia::MaybeSupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/ogg"), QMultimedia::ProbablySupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/wav"), QMultimedia::ProbablySupported); - - //test low latency flag support - QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList()), - QMultimedia::ProbablySupported); - //plugin1 probably supports audio/ogg, it checked because it doesn't provide features iface - QCOMPARE(QMediaPlayer::hasSupport("audio/ogg", QStringList()), - QMultimedia::ProbablySupported); - //Plugin4 is not checked here, sine it's known not support low latency - QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList()), - QMultimedia::MaybeSupported); - - //test streaming flag support - QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList()), - QMultimedia::ProbablySupported); - //Plugin2 is not checked here, sine it's known not support streaming - QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList()), - QMultimedia::MaybeSupported); - - //ensure the correct media player plugin is chosen for mime type - QMediaPlayer simplePlayer(nullptr); - QCOMPARE(simplePlayer.service()->objectName(), QLatin1String("MockServicePlugin2")); - - QMediaPlayer mediaPlayer; - QVERIFY(mediaPlayer.service()->objectName() != QLatin1String("MockServicePlugin2")); - - QMediaPlayer streamPlayer(nullptr); - QCOMPARE(streamPlayer.service()->objectName(), QLatin1String("MockServicePlugin4")); -} - -void tst_QMediaServiceProvider::testSupportedMimeTypes() -{ - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QVERIFY(provider->supportedMimeTypes(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER)).contains("audio/ogg")); - QVERIFY(!provider->supportedMimeTypes(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER)).contains("audio/mp3")); -} - -void tst_QMediaServiceProvider::testDefaultDevice() -{ - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QCOMPARE(provider->defaultDevice(Q_MEDIASERVICE_AUDIOSOURCE), QByteArray("audiosource1")); - QCOMPARE(provider->defaultDevice(Q_MEDIASERVICE_CAMERA), QByteArray("frontcamera")); -} - -void tst_QMediaServiceProvider::testAvailableDevices() -{ - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QList<QByteArray> devices = provider->devices(Q_MEDIASERVICE_AUDIOSOURCE); - QCOMPARE(devices.count(), 2); - QCOMPARE(devices.at(0), QByteArray("audiosource1")); - QCOMPARE(devices.at(1), QByteArray("audiosource2")); - - devices = provider->devices(Q_MEDIASERVICE_CAMERA); - QCOMPARE(devices.count(), 3); - QCOMPARE(devices.at(0), QByteArray("frontcamera")); - QCOMPARE(devices.at(1), QByteArray("backcamera")); - QCOMPARE(devices.at(2), QByteArray("somecamera")); -} - -void tst_QMediaServiceProvider::testCameraInfo() -{ - QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); - - if (provider == nullptr) - QSKIP("No default provider"); - - QCOMPARE(provider->cameraPosition("backcamera"), QCamera::BackFace); - QCOMPARE(provider->cameraOrientation("backcamera"), 90); - QCOMPARE(provider->cameraPosition("frontcamera"), QCamera::FrontFace); - QCOMPARE(provider->cameraOrientation("frontcamera"), 270); - QCOMPARE(provider->cameraPosition("somecamera"), QCamera::UnspecifiedPosition); - QCOMPARE(provider->cameraOrientation("somecamera"), 0); - - { - QCamera camera; - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin3")); - } - - { - QCamera camera(QMediaDeviceManager::defaultVideoInput()); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin3")); - } - - { - QCamera camera(QMediaDeviceManager::videoInputs().at(0)); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin3")); - } - - { - QCamera camera(QMediaDeviceManager::videoInputs().at(1)); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin5")); - } - - { - QCamera camera(QMediaDeviceManager::videoInputs().at(2)); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin5")); - } - - { - QCamera camera(QCamera::FrontFace); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin3")); - } - - { - QCamera camera(QCamera::BackFace); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin5")); - } - - { - QCamera camera(QCamera::UnspecifiedPosition); - QVERIFY(camera.service()); - QCOMPARE(camera.service()->objectName(), QLatin1String("MockServicePlugin3")); - } -} - -QTEST_MAIN(tst_QMediaServiceProvider) - -#include "tst_qmediaserviceprovider.moc" |