diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimations')
3 files changed, 55 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/data/pauseBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/pauseBug.qml new file mode 100644 index 0000000000..fa2c4be4ba --- /dev/null +++ b/tests/auto/declarative/qdeclarativeanimations/data/pauseBug.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +SequentialAnimation { + id: animation + running: true + ScriptAction { script: animation.paused = true } +} diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 9308aca208..bd9c3e0d7a 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -89,6 +89,8 @@ private slots: void doubleRegistrationBug(); void alwaysRunToEndRestartBug(); void transitionAssignmentBug(); + void pauseBindingBug(); + void pauseBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -857,6 +859,35 @@ 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; +} + +//QTBUG-13598 +void tst_qdeclarativeanimations::pauseBug() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/pauseBug.qml"); + QDeclarativeAbstractAnimation *anim = qobject_cast<QDeclarativeAbstractAnimation*>(c.create()); + QVERIFY(anim != 0); + QCOMPARE(anim->qtAnimation()->state(), QAbstractAnimation::Paused); + QCOMPARE(anim->isPaused(), true); + QCOMPARE(anim->isRunning(), true); + + delete anim; +} + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" |