diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-03 05:31:07 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-03 05:32:28 (GMT) |
commit | c8be1c487994fda855b9f2dc7c005db4686981c0 (patch) | |
tree | 2629236ce0cbfdc94ac454a14368f0a46bca42d7 /tests/auto/declarative/animatedimage | |
parent | 43c15688888b433d6d3c01c0d68168fec81cf06a (diff) | |
download | Qt-c8be1c487994fda855b9f2dc7c005db4686981c0.zip Qt-c8be1c487994fda855b9f2dc7c005db4686981c0.tar.gz Qt-c8be1c487994fda855b9f2dc7c005db4686981c0.tar.bz2 |
Get AnimatedImage + autotests working again.
There are still failures, but at least the tests no longer crash.
Diffstat (limited to 'tests/auto/declarative/animatedimage')
-rw-r--r-- | tests/auto/declarative/animatedimage/tst_animatedimage.cpp | 38 |
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) |