summaryrefslogtreecommitdiffstats
path: root/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-05 08:30:28 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-08-05 08:30:28 +1000
commit40db84c97769141f3f2351de1b2d5c64904fe5c2 (patch)
treef674a92a37a130e1ce0bfd7080019fe3b36e9c1b /tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
parent897014a47b41dcf2b9d91549be9b96890d5291c7 (diff)
parent2843c97f5310f4636c933ced56570ab7db2b707e (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp')
-rw-r--r--tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index d7d6b8843..16c58b0d4 100644
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -74,6 +74,7 @@ private slots:
void loopCount_data();
void loopCount();
void autoAdd();
+ void pauseResume();
};
tst_QParallelAnimationGroup::tst_QParallelAnimationGroup()
@@ -828,5 +829,37 @@ void tst_QParallelAnimationGroup::autoAdd()
QCOMPARE(group.duration(), 0);
}
+void tst_QParallelAnimationGroup::pauseResume()
+{
+ QParallelAnimationGroup group;
+ TestAnimation2 *anim = new TestAnimation2(250, &group); // 0, duration = 250;
+ QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QCOMPARE(group.duration(), 250);
+ group.start();
+ QTest::qWait(100);
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(anim->state(), QAnimationGroup::Running);
+ QCOMPARE(spy.count(), 1);
+ spy.clear();
+ const int currentTime = group.currentTime();
+ QCOMPARE(anim->currentTime(), currentTime);
+
+ group.pause();
+ QCOMPARE(group.state(), QAnimationGroup::Paused);
+ QCOMPARE(group.currentTime(), currentTime);
+ QCOMPARE(anim->state(), QAnimationGroup::Paused);
+ QCOMPARE(anim->currentTime(), currentTime);
+ QCOMPARE(spy.count(), 1);
+ spy.clear();
+
+ group.resume();
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(group.currentTime(), currentTime);
+ QCOMPARE(anim->state(), QAnimationGroup::Running);
+ QCOMPARE(anim->currentTime(), currentTime);
+ QCOMPARE(spy.count(), 1);
+}
+
+
QTEST_MAIN(tst_QParallelAnimationGroup)
#include "tst_qparallelanimationgroup.moc"