summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp20
-rw-r--r--tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp13
2 files changed, 32 insertions, 1 deletions
diff --git a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
index 707a01512..3059a4641 100644
--- a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
@@ -106,6 +106,7 @@ public slots:
private slots:
void fillMode();
+ void flushMode();
void orientation();
void surfaceSource();
void sourceRect();
@@ -161,6 +162,7 @@ void tst_QDeclarativeVideoOutput::initTestCase()
}
Q_DECLARE_METATYPE(QDeclarativeVideoOutput::FillMode)
+Q_DECLARE_METATYPE(QDeclarativeVideoOutput::FlushMode)
tst_QDeclarativeVideoOutput::tst_QDeclarativeVideoOutput()
: m_mappingComponent(0)
@@ -199,6 +201,24 @@ void tst_QDeclarativeVideoOutput::fillMode()
delete videoOutput;
}
+void tst_QDeclarativeVideoOutput::flushMode()
+{
+ QQmlComponent component(&m_engine);
+ component.setData(m_plainQML, QUrl());
+
+ QObject *videoOutput = component.create();
+ QVERIFY(videoOutput != 0);
+
+ QSignalSpy propSpy(videoOutput, SIGNAL(flushModeChanged()));
+
+ QCOMPARE(videoOutput->property("flushMode").value<QDeclarativeVideoOutput::FlushMode>(), QDeclarativeVideoOutput::EmptyFrame);
+ QCOMPARE(propSpy.count(), 0);
+
+ videoOutput->setProperty("flushMode", QVariant(int(QDeclarativeVideoOutput::FirstFrame)));
+ QCOMPARE(videoOutput->property("fillMode").value<QDeclarativeVideoOutput::FlushMode>(), QDeclarativeVideoOutput::FirstFrame);
+ QCOMPARE(propSpy.count(), 1);
+}
+
void tst_QDeclarativeVideoOutput::orientation()
{
QQmlComponent component(&m_engine);
diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp
index fa98c8b16..7cbd57007 100644
--- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp
+++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp
@@ -60,6 +60,7 @@ private slots:
void testSetSourceWhileLoading();
void testSetSourceWhilePlaying();
+ void testSupportedMimeTypes_data();
void testSupportedMimeTypes();
void testCorruptFile();
void testPlaying24Bits();
@@ -387,9 +388,19 @@ void tst_QSoundEffect::testSetSourceWhilePlaying()
}
}
+void tst_QSoundEffect::testSupportedMimeTypes_data()
+{
+ // Verify also passing of audio device info as parameter
+ QTest::addColumn<QSoundEffect*>("instance");
+ QTest::newRow("without QAudioDeviceInfo") << sound;
+ QAudioDeviceInfo deviceInfo(QAudioDeviceInfo::defaultOutputDevice());
+ QTest::newRow("with QAudioDeviceInfo") << new QSoundEffect(deviceInfo, this);
+}
+
void tst_QSoundEffect::testSupportedMimeTypes()
{
- QStringList mimeTypes = sound->supportedMimeTypes();
+ QFETCH(QSoundEffect*, instance);
+ QStringList mimeTypes = instance->supportedMimeTypes();
QVERIFY(!mimeTypes.empty());
QVERIFY(mimeTypes.indexOf(QLatin1String("audio/wav")) != -1 ||
mimeTypes.indexOf(QLatin1String("audio/x-wav")) != -1 ||