Replaced QAudioCaptureSource with QAudioRecorder.
QAudioCaptureSource name is confusing, it's essentially an audio recording service but it's not evident from API. QAudioRecorder replaces QAudioCaptureSource+QMediaRecorder combination. Change-Id: I0082d766fc0d1b8d5ecbfc527f13e715add730c8 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
8c74e5e7e7
commit
69cef0c24c
@@ -48,7 +48,6 @@
|
||||
#include <qmediaobject.h>
|
||||
#include <qmediaservice.h>
|
||||
#include <qmetadatareadercontrol.h>
|
||||
#include <qaudiocapturesource.h>
|
||||
#include <qaudioendpointselector.h>
|
||||
|
||||
#include "mockmediarecorderservice.h"
|
||||
@@ -103,7 +102,6 @@ private slots:
|
||||
void extendedMetaData();
|
||||
|
||||
void service();
|
||||
void availabilityChangedSignal();
|
||||
|
||||
private:
|
||||
void setupNotifyTests();
|
||||
@@ -474,30 +472,6 @@ void tst_QMediaObject::availability()
|
||||
QtTestMediaObject mediaObject2;
|
||||
QMediaService *service2 = mediaObject2.service();
|
||||
QVERIFY(service2 == NULL);
|
||||
}
|
||||
|
||||
void tst_QMediaObject::availabilityChangedSignal()
|
||||
{
|
||||
// The availabilityChangedSignal is implemented in QAudioCaptureSource. So using it to test the signal.
|
||||
MockMediaRecorderService *mockAudioSourceService = new MockMediaRecorderService;
|
||||
MockMediaServiceProvider *mockProvider = new MockMediaServiceProvider(mockAudioSourceService);
|
||||
QAudioCaptureSource *audiosource = new QAudioCaptureSource(0, mockProvider);
|
||||
|
||||
QSignalSpy spy(audiosource, SIGNAL(availabilityChanged(bool)));
|
||||
|
||||
// Add the end points and verify if the availablity changed signal emitted with argument true.
|
||||
QMetaObject::invokeMethod(mockAudioSourceService->mockAudioEndpointSelector, "addEndpoints");
|
||||
QVERIFY(spy.count() == 1);
|
||||
bool available = qvariant_cast<bool>(spy.at(0).at(0));
|
||||
QVERIFY(available == true);
|
||||
|
||||
spy.clear();
|
||||
|
||||
// Remove all endpoints and verify if the signal is emitted with argument false.
|
||||
QMetaObject::invokeMethod(mockAudioSourceService->mockAudioEndpointSelector, "removeEndpoints");
|
||||
QVERIFY(spy.count() == 1);
|
||||
available = qvariant_cast<bool>(spy.at(0).at(0));
|
||||
QVERIFY(available == false);
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(tst_QMediaObject)
|
||||
|
||||
Reference in New Issue
Block a user