aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-09-05 00:19:51 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-10 13:29:27 +0200
commit105d6758d96e2c723c885efa4dc82938f2cc2d1f (patch)
treeabd6f5d20469e8a1d86167a63ccd6a16f34b1b25 /tests/auto
parent5f4df5a39be121ca60cac2b06cf94bead76d74d9 (diff)
Introduce TaskbarProgress::stop()
Change-Id: Id37e6c5e41ab196cd72148b3242332796b1c54ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Ivan Vizir <define-true-false@yandex.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp b/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp
index aa88276..e5e1a63 100644
--- a/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp
+++ b/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp
@@ -52,6 +52,7 @@ private slots:
void testRange();
void testPause();
void testVisibility();
+ void testStop();
};
void tst_QWinTaskbarProgress::testValue()
@@ -162,6 +163,12 @@ void tst_QWinTaskbarProgress::testPause()
QCOMPARE(pausedSpy.count(), 2);
QCOMPARE(pausedSpy.last().at(0).toBool(), false);
+ progress->stop();
+ progress->pause();
+ QVERIFY(!progress->isPaused());
+ QCOMPARE(pausedSpy.count(), 2);
+
+ progress->resume();
progress->pause();
QVERIFY(progress->isPaused());
QCOMPARE(pausedSpy.count(), 3);
@@ -194,6 +201,31 @@ void tst_QWinTaskbarProgress::testVisibility()
QCOMPARE(visibleSpy.last().at(0).toBool(), false);
}
+void tst_QWinTaskbarProgress::testStop()
+{
+ QWinTaskbarButton btn;
+ QWinTaskbarProgress *progress = btn.progress();
+ QVERIFY(progress);
+ QVERIFY(!progress->isStopped());
+
+ QSignalSpy stoppedSpy(progress, SIGNAL(stoppedChanged(bool)));
+ QVERIFY(stoppedSpy.isValid());
+
+ progress->pause();
+ QVERIFY(progress->isPaused());
+ QVERIFY(!progress->isStopped());
+ progress->stop();
+ QVERIFY(!progress->isPaused());
+ QVERIFY(progress->isStopped());
+ QCOMPARE(stoppedSpy.count(), 1);
+ QCOMPARE(stoppedSpy.last().at(0).toBool(), true);
+
+ progress->resume();
+ QVERIFY(!progress->isStopped());
+ QCOMPARE(stoppedSpy.count(), 2);
+ QCOMPARE(stoppedSpy.last().at(0).toBool(), false);
+}
+
QTEST_MAIN(tst_QWinTaskbarProgress)
#include "tst_qwintaskbarprogress.moc"