summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2012-08-16 14:45:46 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-28 04:03:54 +0200
commit8a3706a5a1a9d5839327ede3fa625da8f3c34979 (patch)
tree43d106d3d2a50fe8487fb3eeebf78c0a840d7e23
parent37b872da9eced344dd5feaf1898cab0d02984ea5 (diff)
Camera integration test fixesv5.0.0-beta1
Skip the testCtorWithDevice test if camera doesn't support devices selection; Allow synchronous camera status changes Change-Id: I14f4a74f8a92b8dc2f75f8f5df2bcf9c124bda68 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index f46ba9b1..80651c4c 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -128,17 +128,16 @@ void tst_QCameraBackend::testDeviceDescription()
void tst_QCameraBackend::testCtorWithDevice()
{
- int deviceCount = QMediaServiceProvider::defaultServiceProvider()->devices(QByteArray(Q_MEDIASERVICE_CAMERA)).count();
- QCamera *camera = 0;
+ if (QCamera::availableDevices().isEmpty())
+ QSKIP("Camera selection not supported");
- if (deviceCount == 0) {
- camera = new QCamera("random");
- QCOMPARE(camera->error(), QCamera::ServiceMissingError);
- }
- else {
- camera = new QCamera(QCamera::availableDevices().first());
- QCOMPARE(camera->error(), QCamera::NoError);
- }
+ QCamera *camera = new QCamera(QCamera::availableDevices().first());
+ QCOMPARE(camera->error(), QCamera::NoError);
+ delete camera;
+
+ //loading non existing camera should fail
+ camera = new QCamera(QUuid::createUuid().toByteArray());
+ QCOMPARE(camera->error(), QCamera::ServiceMissingError);
delete camera;
}
@@ -608,7 +607,8 @@ void tst_QCameraBackend::testVideoRecording()
QCOMPARE(recorder.status(), QMediaRecorder::UnloadedStatus);
camera->start();
- QCOMPARE(recorder.status(), QMediaRecorder::LoadingStatus);
+ QVERIFY(recorder.status() == QMediaRecorder::LoadingStatus ||
+ recorder.status() == QMediaRecorder::LoadedStatus);
QCOMPARE(recorderStatusSignal.last().first().value<QMediaRecorder::Status>(), recorder.status());
QTRY_COMPARE(camera->status(), QCamera::ActiveStatus);
QTRY_COMPARE(recorder.status(), QMediaRecorder::LoadedStatus);