diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-08-07 11:41:44 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-08-07 10:31:10 +0000 |
commit | 9e1c673cbcb03744920d3663112177c00af1dacb (patch) | |
tree | 092a710c7d1379f98fda08a807a18e7cfc9f7554 /tests/manual/gifs/tst_gifs.cpp | |
parent | f85da563f6a7a307b40ec6abd93e28de3793aa02 (diff) |
BusyIndicator: add manual GIF test.
The GIF isn't added yet, because byzanz-record
only allows a certain amount of colors, so we must
fix that first.
Change-Id: I5c438ade6e8a6e7065742003e804c30bb23aa96a
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/manual/gifs/tst_gifs.cpp')
-rw-r--r-- | tests/manual/gifs/tst_gifs.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index f61f609f..acaa49d4 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -51,6 +51,7 @@ private slots: void tumblerWrap(); void slider(); + void busyIndicator(); private: QQuickView view; @@ -261,6 +262,35 @@ void tst_Gifs::slider() gifRecorder.waitForFinish(); } +void tst_Gifs::busyIndicator() +{ + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(4); + gifRecorder.setQmlFileName("qtquickcontrols2-busyindicator.qml"); + gifRecorder.setView(&view); + + view.show(); + + gifRecorder.start(); + + // Record nothing for a bit to make it smoother. + QTest::qWait(400); + + QQuickItem *busyIndicator = view.rootObject()->property("busyIndicator").value<QQuickItem*>(); + QVERIFY(busyIndicator); + + busyIndicator->setProperty("running", true); + + // 800 ms is the duration of one rotation animation cycle for BusyIndicator. + QTest::qWait(800 * 3); + + busyIndicator->setProperty("running", false); + + gifRecorder.waitForFinish(); +} + QTEST_MAIN(tst_Gifs) #include "tst_gifs.moc" |