aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index bd9c3e0d7a..367de014b4 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -77,6 +77,7 @@ private slots:
void mixedTypes();
void properties();
void propertiesTransition();
+ void disabledTransition();
void invalidDuration();
void attached();
void propertyValueSourceDefaultStart();
@@ -576,6 +577,32 @@ void tst_qdeclarativeanimations::propertiesTransition()
}
+void tst_qdeclarativeanimations::disabledTransition()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabledTransition.qml"));
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect");
+ QVERIFY(myRect);
+
+ QDeclarativeTransition *trans = rect->findChild<QDeclarativeTransition*>();
+ QVERIFY(trans);
+
+ QCOMPARE(trans->enabled(), false);
+
+ QSGItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+
+ trans->setEnabled(true);
+
+ QSGItemPrivate::get(rect)->setState("");
+ QCOMPARE(myRect->x(),qreal(200));
+ QTest::qWait(300);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+}
+
void tst_qdeclarativeanimations::invalidDuration()
{
QDeclarativePropertyAnimation *animation = new QDeclarativePropertyAnimation;