summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
index 31efc64..39ce9eb 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
@@ -72,6 +72,8 @@ private slots:
void frameCount();
void remote();
void remote_data();
+ void sourceSize();
+ void sourceSizeReadOnly();
void invalidSource();
};
@@ -155,10 +157,32 @@ void tst_qdeclarativeanimatedimage::remote()
TRY_WAIT(anim->isPaused());
QCOMPARE(anim->currentFrame(), 2);
}
+ QVERIFY(anim->status() != QDeclarativeAnimatedImage::Error);
delete anim;
}
+void tst_qdeclarativeanimatedimage::sourceSize()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanscaled.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QCOMPARE(anim->width(),240.0);
+ QCOMPARE(anim->height(),180.0);
+ QCOMPARE(anim->sourceSize(),QSize(160,120));
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::sourceSizeReadOnly()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanerror1.qml"));
+ QVERIFY(component.isError());
+ QCOMPARE(component.errors().at(0).description(), QString("Invalid property assignment: \"sourceSize\" is a read-only property"));
+}
+
void tst_qdeclarativeanimatedimage::remote_data()
{
QTest::addColumn<QString>("fileName");