aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-07-29 13:10:25 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-29 09:39:41 +0200
commit62917a96222ac8d3a391b0aefe2ee8905c8da874 (patch)
tree45a8dae96425312318e43b7efed5e8f8f5e5915d /tests
parentcbd0bc1fbcbe48811d2e80df5cae9c9c523863a0 (diff)
Ensure bindings on pause work correctly.
Defer the actual pause, in the same way we defer the actual start. Task-number: QTBUG-19080 Change-Id: I500e5aa6678cbb5321979fda31f60d6d6e19a61e Reviewed-on: http://codereview.qt.nokia.com/2366 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/pauseBindingBug.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp15
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/pauseBindingBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/pauseBindingBug.qml
new file mode 100644
index 0000000000..359cda166f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/pauseBindingBug.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 200
+ height: 200
+
+ property bool animating: false
+ property int value: 0
+
+ NumberAnimation on value {
+ objectName: "animation"
+ paused: !rect.animating
+ to: 100
+ duration: 50
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index 9308aca208..6461b69198 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -89,6 +89,7 @@ private slots:
void doubleRegistrationBug();
void alwaysRunToEndRestartBug();
void transitionAssignmentBug();
+ void pauseBindingBug();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -857,6 +858,20 @@ void tst_qdeclarativeanimations::transitionAssignmentBug()
QCOMPARE(rect->property("nullObject").toBool(), false);
}
+//QTBUG-19080
+void tst_qdeclarativeanimations::pauseBindingBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/pauseBindingBug.qml");
+ QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation");
+ QVERIFY(anim->qtAnimation()->state() == QAbstractAnimation::Paused);
+
+ delete rect;
+}
+
QTEST_MAIN(tst_qdeclarativeanimations)
#include "tst_qdeclarativeanimations.moc"