summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-29 00:43:42 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-29 00:43:42 (GMT)
commit189d2660968368532761586ffd495eb6c18cdbdf (patch)
tree36edb9c9da0c366cb8b00015f3cc52929575111a /tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
parent5b0de255d1facfe89efed393447a1c914ffdf414 (diff)
downloadQt-189d2660968368532761586ffd495eb6c18cdbdf.zip
Qt-189d2660968368532761586ffd495eb6c18cdbdf.tar.gz
Qt-189d2660968368532761586ffd495eb6c18cdbdf.tar.bz2
Ensure Loader item change listener is removed when Loader is destroyed
Task-number: QTBUG-11771
Diffstat (limited to 'tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
index d047a2a..b0b7a3b 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -47,6 +47,7 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativeloader_p.h>
#include "testhttpserver.h"
+#include "../../../shared/util.h"
#define SERVER_PORT 14450
@@ -176,9 +177,7 @@ void tst_QDeclarativeLoader::clear()
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
- QTest::qWait(500);
-
- QVERIFY(loader->item() == 0);
+ QTRY_VERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
QCOMPARE(loader->status(), QDeclarativeLoader::Null);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
@@ -239,8 +238,8 @@ void tst_QDeclarativeLoader::urlToComponent()
"}" )
, TEST_FILE(""));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
- QTest::qWait(500);
- QVERIFY(loader != 0);
+ QTest::qWait(200);
+ QTRY_VERIFY(loader != 0);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);