summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
index de11fe2..15caea6 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <qtest.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qtimer.h>
#include <QtScript/qscriptengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
@@ -67,11 +68,13 @@ private slots:
private:
void waitForEchoMessage(QDeclarativeWorkerScript *worker) {
- const QMetaObject *mo = worker->metaObject();
- int index = mo->indexOfProperty("done");
- QVERIFY(index >= 0);
- QTRY_COMPARE(mo->property(index).read(worker).toBool(), true);
- QTRY_COMPARE(mo->property(mo->indexOfProperty("done")).read(worker).toBool(), true);
+ QEventLoop loop;
+ QVERIFY(connect(worker, SIGNAL(done()), &loop, SLOT(quit())));
+ QTimer timer;
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.start(1000);
+ loop.exec();
+ QVERIFY(timer.isActive());
}
QDeclarativeEngine m_engine;