diff options
-rw-r--r-- | tests/auto/unit/mockbackend/qmockmediaencoder.h | 10 | ||||
-rw-r--r-- | tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/unit/mockbackend/qmockmediaencoder.h b/tests/auto/unit/mockbackend/qmockmediaencoder.h index 06e10c24a..88ef5b3f9 100644 --- a/tests/auto/unit/mockbackend/qmockmediaencoder.h +++ b/tests/auto/unit/mockbackend/qmockmediaencoder.h @@ -100,6 +100,16 @@ public: emit stateChanged(m_state); } + void reset() + { + m_state = QMediaRecorder::StoppedState; + m_settings = QMediaEncoderSettings(); + m_position = 0; + emit stateChanged(m_state); + emit durationChanged(m_position); + clearActualLocation(); + } + public: QMediaMetaData m_metaData; QMediaRecorder::RecorderState m_state; diff --git a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp index 30ba55c33..9808d065d 100644 --- a/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp +++ b/tests/auto/unit/multimedia/qmediarecorder/tst_qmediarecorder.cpp @@ -226,6 +226,8 @@ void tst_QMediaRecorder::testSink() QCOMPARE(encoder->actualLocation(), QUrl::fromLocalFile("default_name.mp4")); encoder->stop(); QCOMPARE(encoder->actualLocation(), QUrl::fromLocalFile("default_name.mp4")); + + mock->reset(); } void tst_QMediaRecorder::testRecord() @@ -261,6 +263,8 @@ void tst_QMediaRecorder::testRecord() mock->stop(); QCOMPARE(stateSignal.count(), 3); + + mock->reset(); } void tst_QMediaRecorder::testEncodingSettings() |