summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qmltimer/tst_qmltimer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
index d3b273c..9c5dc30 100644
--- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
+++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
@@ -53,6 +53,7 @@ private slots:
void notRepeating();
void notRepeatingStart();
void repeat();
+ void noTriggerIfNotRunning();
void triggeredOnStart();
void triggeredOnStartRepeat();
};
@@ -176,6 +177,22 @@ void tst_qmltimer::triggeredOnStartRepeat()
QVERIFY(helper.count > oldCount);
}
+void tst_qmltimer::noTriggerIfNotRunning()
+{
+ QmlEngine engine;
+ QmlComponent component(&engine, QByteArray(
+ "import Qt 4.6\n"
+ "Item { property bool ok: true\n"
+ "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
+ "Timer { interval: 10; running: true; onTriggered: t1.running=false }"
+ "}"
+ ), QUrl("file://"));
+ QObject *item = component.create();
+ QVERIFY(item != 0);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(item->property("ok").toBool(), true);
+}
+
QTEST_MAIN(tst_qmltimer)
#include "tst_qmltimer.moc"