summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-12-22 09:47:23 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-21 11:21:05 +0000
commit652cd926157c8738f896b6e04aac690283f6a8df (patch)
tree0be962ce9e66f1c57dc8321b5138c42f20506365 /tests
parentbab71b4834d27d018c2d45b592d16f56fcbb7bbe (diff)
Merge QCameraFlashControl into QCameraExposureControl
They are exposwed through one class on the front-end side, no need to complicate the API with several interfaces on the backend side. Change-Id: I4ecdc96edf71353f1b6d31cab92b7df064033e9a Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp1
-rw-r--r--tests/auto/unit/qcamera/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcamera/tst_qcamera.cpp1
-rw-r--r--tests/auto/unit/qcameraimagecapture/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcameraimagecapture/tst_qcameraimagecapture.cpp1
-rw-r--r--tests/auto/unit/qcamerainfo/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcameraviewfinder/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcamerawidgets/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qcamerawidgets/tst_qcamerawidgets.cpp1
-rw-r--r--tests/auto/unit/qdeclarativecamera/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt1
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcamera.pri1
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h26
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h76
-rw-r--r--tests/auto/unit/qmultimedia_common/mockcameraservice.h6
15 files changed, 26 insertions, 94 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index 25b529610..cd56ca1ac 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -36,7 +36,6 @@
#include <qcameracontrol.h>
#include <qcameralockscontrol.h>
#include <qcameraexposurecontrol.h>
-#include <qcameraflashcontrol.h>
#include <qcamerafocuscontrol.h>
#include <qcameraimagecapturecontrol.h>
#include <qimageencodercontrol.h>
diff --git a/tests/auto/unit/qcamera/CMakeLists.txt b/tests/auto/unit/qcamera/CMakeLists.txt
index 24c00fe45..98f1e683b 100644
--- a/tests/auto/unit/qcamera/CMakeLists.txt
+++ b/tests/auto/unit/qcamera/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_add_test(tst_qcamera
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qcamera/tst_qcamera.cpp b/tests/auto/unit/qcamera/tst_qcamera.cpp
index 40a5ca483..971ba53c1 100644
--- a/tests/auto/unit/qcamera/tst_qcamera.cpp
+++ b/tests/auto/unit/qcamera/tst_qcamera.cpp
@@ -35,7 +35,6 @@
#include <qcameracontrol.h>
#include <qcameralockscontrol.h>
#include <qcameraexposurecontrol.h>
-#include <qcameraflashcontrol.h>
#include <qcamerafocuscontrol.h>
#include <qcameraimagecapturecontrol.h>
#include <qimageencodercontrol.h>
diff --git a/tests/auto/unit/qcameraimagecapture/CMakeLists.txt b/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
index 33236798d..80f24144c 100644
--- a/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
+++ b/tests/auto/unit/qcameraimagecapture/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_add_test(tst_qcameraimagecapture
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qcameraimagecapture/tst_qcameraimagecapture.cpp b/tests/auto/unit/qcameraimagecapture/tst_qcameraimagecapture.cpp
index c45c2e629..cab3f8984 100644
--- a/tests/auto/unit/qcameraimagecapture/tst_qcameraimagecapture.cpp
+++ b/tests/auto/unit/qcameraimagecapture/tst_qcameraimagecapture.cpp
@@ -42,7 +42,6 @@ Reviewer Name Date Coverage ( Full / Test Case IDs ).
#include <qcameracontrol.h>
#include <qcameralockscontrol.h>
#include <qcameraexposurecontrol.h>
-#include <qcameraflashcontrol.h>
#include <qcamerafocuscontrol.h>
#include <qcameraimagecapturecontrol.h>
#include <qimageencodercontrol.h>
diff --git a/tests/auto/unit/qcamerainfo/CMakeLists.txt b/tests/auto/unit/qcamerainfo/CMakeLists.txt
index 2472f5dc8..74d59e8c7 100644
--- a/tests/auto/unit/qcamerainfo/CMakeLists.txt
+++ b/tests/auto/unit/qcamerainfo/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_add_test(tst_qcamerainfo
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qcameraviewfinder/CMakeLists.txt b/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
index a7bd7d078..c7cc40e28 100644
--- a/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
+++ b/tests/auto/unit/qcameraviewfinder/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_add_test(tst_qcameraviewfinder
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qcamerawidgets/CMakeLists.txt b/tests/auto/unit/qcamerawidgets/CMakeLists.txt
index 46d501e57..30739126d 100644
--- a/tests/auto/unit/qcamerawidgets/CMakeLists.txt
+++ b/tests/auto/unit/qcamerawidgets/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_add_test(tst_qcamerawidgets
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qcamerawidgets/tst_qcamerawidgets.cpp b/tests/auto/unit/qcamerawidgets/tst_qcamerawidgets.cpp
index 7f560bd2d..72ef219a0 100644
--- a/tests/auto/unit/qcamerawidgets/tst_qcamerawidgets.cpp
+++ b/tests/auto/unit/qcamerawidgets/tst_qcamerawidgets.cpp
@@ -35,7 +35,6 @@
#include <qcameracontrol.h>
#include <qcameralockscontrol.h>
#include <qcameraexposurecontrol.h>
-#include <qcameraflashcontrol.h>
#include <qcamerafocuscontrol.h>
#include <qcameraimagecapturecontrol.h>
#include <qimageencodercontrol.h>
diff --git a/tests/auto/unit/qdeclarativecamera/CMakeLists.txt b/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
index 8cf41da77..1a0098976 100644
--- a/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
+++ b/tests/auto/unit/qdeclarativecamera/CMakeLists.txt
@@ -11,7 +11,6 @@ qt_add_test(tst_qdeclarativecamera
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt b/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
index a12975ce5..00db536b0 100644
--- a/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
+++ b/tests/auto/unit/qdeclarativemultimediaglobal/CMakeLists.txt
@@ -11,7 +11,6 @@ qt_add_test(tst_qdeclarativemultimediaglobal
../qmultimedia_common/mockcameracapturebuffercontrol.h
../qmultimedia_common/mockcameracontrol.h
../qmultimedia_common/mockcameraexposurecontrol.h
- ../qmultimedia_common/mockcameraflashcontrol.h
../qmultimedia_common/mockcamerafocuscontrol.h
../qmultimedia_common/mockcameraimagecapturecontrol.h
../qmultimedia_common/mockcameraimageprocessingcontrol.h
diff --git a/tests/auto/unit/qmultimedia_common/mockcamera.pri b/tests/auto/unit/qmultimedia_common/mockcamera.pri
index 58825b521..9222b12a2 100644
--- a/tests/auto/unit/qmultimedia_common/mockcamera.pri
+++ b/tests/auto/unit/qmultimedia_common/mockcamera.pri
@@ -6,7 +6,6 @@ INCLUDEPATH += $$PWD \
HEADERS *= \
../qmultimedia_common/mockcameraservice.h \
- ../qmultimedia_common/mockcameraflashcontrol.h \
../qmultimedia_common/mockcameralockscontrol.h \
../qmultimedia_common/mockcamerafocuscontrol.h \
../qmultimedia_common/mockcamerazoomcontrol.h \
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h b/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
index 14cb69c86..435c272a0 100644
--- a/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
+++ b/tests/auto/unit/qmultimedia_common/mockcameraexposurecontrol.h
@@ -230,6 +230,32 @@ public:
return true;
}
+ QCameraExposure::FlashModes flashMode() const
+ {
+ return m_flashMode;
+ }
+
+ void setFlashMode(QCameraExposure::FlashModes mode)
+ {
+ if (isFlashModeSupported(mode)) {
+ m_flashMode = mode;
+ }
+ emit flashReady(true);
+ }
+ //Setting the values for Flash mode
+
+ bool isFlashModeSupported(QCameraExposure::FlashModes mode) const
+ {
+ return (mode & (QCameraExposure::FlashAuto | QCameraExposure::FlashOff | QCameraExposure::FlashOn |
+ QCameraExposure::FlashFill |QCameraExposure::FlashTorch |QCameraExposure::FlashSlowSyncFrontCurtain |
+ QCameraExposure::FlashRedEyeReduction));
+ }
+
+ bool isFlashReady() const
+ {
+ return true;
+ }
+
private:
qreal m_aperture;
qreal m_shutterSpeed;
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h b/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h
deleted file mode 100644
index 96e2ebc52..000000000
--- a/tests/auto/unit/qmultimedia_common/mockcameraflashcontrol.h
+++ /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 test suite 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 MOCKCAMERAFLASHCONTROL_H
-#define MOCKCAMERAFLASHCONTROL_H
-
-#include "qcameraflashcontrol.h"
-
-class MockCameraFlashControl : public QCameraFlashControl
-{
- Q_OBJECT
-public:
- MockCameraFlashControl(QObject *parent = 0):
- QCameraFlashControl(parent),
- m_flashMode(QCameraExposure::FlashAuto)
- {
- }
-
- ~MockCameraFlashControl() {}
-
- QCameraExposure::FlashModes flashMode() const
- {
- return m_flashMode;
- }
-
- void setFlashMode(QCameraExposure::FlashModes mode)
- {
- if (isFlashModeSupported(mode)) {
- m_flashMode = mode;
- }
- emit flashReady(true);
- }
- //Setting the values for Flash mode
-
- bool isFlashModeSupported(QCameraExposure::FlashModes mode) const
- {
- return (mode & (QCameraExposure::FlashAuto | QCameraExposure::FlashOff | QCameraExposure::FlashOn |
- QCameraExposure::FlashFill |QCameraExposure::FlashTorch |QCameraExposure::FlashSlowSyncFrontCurtain |
- QCameraExposure::FlashRedEyeReduction));
- }
-
- bool isFlashReady() const
- {
- return true;
- }
-
-private:
- QCameraExposure::FlashModes m_flashMode;
-};
-
-#endif // MOCKCAMERAFLASHCONTROL_H
diff --git a/tests/auto/unit/qmultimedia_common/mockcameraservice.h b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
index d6d571cea..98ee6c99a 100644
--- a/tests/auto/unit/qmultimedia_common/mockcameraservice.h
+++ b/tests/auto/unit/qmultimedia_common/mockcameraservice.h
@@ -30,7 +30,6 @@
#define MOCKCAMERASERVICE_H
#include "qmediaservice.h"
-#include "../qmultimedia_common/mockcameraflashcontrol.h"
#include "../qmultimedia_common/mockcameralockscontrol.h"
#include "../qmultimedia_common/mockcamerafocuscontrol.h"
#include "../qmultimedia_common/mockcamerazoomcontrol.h"
@@ -83,7 +82,6 @@ public:
mockControl = new MockCameraControl(this);
mockLocksControl = new MockCameraLocksControl(this);
mockExposureControl = new MockCameraExposureControl(this);
- mockFlashControl = new MockCameraFlashControl(this);
mockFocusControl = new MockCameraFocusControl(this);
mockZoomControl = new MockCameraZoomControl(this);
mockCaptureControl = new MockCaptureControl(mockControl, this);
@@ -113,9 +111,6 @@ public:
if (qstrcmp(iid, QCameraExposureControl_iid) == 0)
return mockExposureControl;
- if (qstrcmp(iid, QCameraFlashControl_iid) == 0)
- return mockFlashControl;
-
if (qstrcmp(iid, QCameraFocusControl_iid) == 0)
return mockFocusControl;
@@ -170,7 +165,6 @@ public:
MockCaptureControl *mockCaptureControl;
MockCaptureBufferFormatControl *mockCaptureBufferControl;
MockCameraExposureControl *mockExposureControl;
- MockCameraFlashControl *mockFlashControl;
MockCameraFocusControl *mockFocusControl;
MockCameraZoomControl *mockZoomControl;
MockImageProcessingControl *mockImageProcessingControl;