summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qfxloader
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-05 04:51:40 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-05 04:51:40 (GMT)
commit7d290c0a38f325a3c024a38bcd5da94877d7fd64 (patch)
tree756d57096d1aeede61d2c4ae483ed4fdc7b9f225 /tests/auto/declarative/qfxloader
parent8fbff4dffd53546e4c3acecd0a9700a7ad970c83 (diff)
downloadQt-7d290c0a38f325a3c024a38bcd5da94877d7fd64.zip
Qt-7d290c0a38f325a3c024a38bcd5da94877d7fd64.tar.gz
Qt-7d290c0a38f325a3c024a38bcd5da94877d7fd64.tar.bz2
Loader cleanup and testing.
Diffstat (limited to 'tests/auto/declarative/qfxloader')
-rw-r--r--tests/auto/declarative/qfxloader/tst_qfxloader.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp
index 9a8f8f1..9a3da90 100644
--- a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp
+++ b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp
@@ -110,14 +110,21 @@ void tst_qfxloader::component()
void tst_qfxloader::clear()
{
- QmlComponent component(&engine, QByteArray("import Qt 4.6\nLoader { source: \"Rect120x60.qml\" }"), QUrl("file://" SRCDIR "/"));
+ QmlComponent component(&engine, QByteArray(
+ "import Qt 4.6\n"
+ " Loader { id: loader\n"
+ " source: 'Rect120x60.qml'\n"
+ " Timer { interval: 200; running: true; onTriggered: loader.source = '' }\n"
+ " }")
+ , QUrl("file://" SRCDIR "/"));
QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create());
QVERIFY(loader != 0);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
- loader->setSource(QUrl(""));
+ QTest::qWait(500);
+
QVERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
@@ -136,7 +143,7 @@ void tst_qfxloader::urlToComponent()
"}" )
, QUrl("file://" SRCDIR "/"));
QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(component.create());
- QTest::qWait(1000);
+ QTest::qWait(500);
QVERIFY(loader != 0);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);