summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-03 05:41:53 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-03 05:41:53 (GMT)
commitea926d74dff5ce9fe2cfff1c27581a24e0976fd2 (patch)
tree36606c87e2ea1495b858dce53bacc8d70373a0b7 /tests/auto
parent9b80a6de7fb70abcf5f912133ddc04c617a82922 (diff)
parentc8be1c487994fda855b9f2dc7c005db4686981c0 (diff)
downloadQt-ea926d74dff5ce9fe2cfff1c27581a24e0976fd2.zip
Qt-ea926d74dff5ce9fe2cfff1c27581a24e0976fd2.tar.gz
Qt-ea926d74dff5ce9fe2cfff1c27581a24e0976fd2.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/animatedimage/tst_animatedimage.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp
index f6141cb..6ae2112 100644
--- a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp
+++ b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp
@@ -61,34 +61,40 @@ private slots:
void tst_animatedimage::play()
{
- QmlGraphicsAnimatedImageItem anim;
- anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif"));
- QVERIFY(anim.isPlaying());
+ QmlEngine engine;
+ QmlComponent component(&engine, QUrl("file://" SRCDIR "/data/stickman.qml"));
+ QmlGraphicsAnimatedImageItem *anim = qobject_cast<QmlGraphicsAnimatedImageItem *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
}
void tst_animatedimage::pause()
{
- QmlGraphicsAnimatedImageItem anim;
- anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif"));
- anim.setPaused(true);
- QVERIFY(!anim.isPlaying());
+ QmlEngine engine;
+ QmlComponent component(&engine, QUrl("file://" SRCDIR "/data/stickmanpause.qml"));
+ QmlGraphicsAnimatedImageItem *anim = qobject_cast<QmlGraphicsAnimatedImageItem *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+ QVERIFY(anim->isPaused());
}
void tst_animatedimage::setFrame()
{
- QmlGraphicsAnimatedImageItem anim;
- anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif"));
- anim.setPaused(true);
- QVERIFY(!anim.isPlaying());
- anim.setCurrentFrame(2);
- QCOMPARE(anim.currentFrame(), 2);
+ QmlEngine engine;
+ QmlComponent component(&engine, QUrl("file://" SRCDIR "/data/stickmanpause.qml"));
+ QmlGraphicsAnimatedImageItem *anim = qobject_cast<QmlGraphicsAnimatedImageItem *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+ QCOMPARE(anim->currentFrame(), 2);
}
void tst_animatedimage::frameCount()
{
- QmlGraphicsAnimatedImageItem anim;
- anim.setSource(QUrl("file://" SRCDIR "/data/stickman.gif"));
- QCOMPARE(anim.frameCount(), 299);
+ QmlEngine engine;
+ QmlComponent component(&engine, QUrl("file://" SRCDIR "/data/stickman.qml"));
+ QmlGraphicsAnimatedImageItem *anim = qobject_cast<QmlGraphicsAnimatedImageItem *>(component.create());
+ QVERIFY(anim);
+ QCOMPARE(anim->frameCount(), 299);
}
QTEST_MAIN(tst_animatedimage)