aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp')
-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"