summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-19 00:18:23 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-19 00:18:23 (GMT)
commitdbd27a3703905a2b48294b63a79b3a92456076b3 (patch)
treef29a39f6ef204cd550faeda2893b929fa66b32ba /tests
parentbb8c3d4f8f064bf53b22d85f875c8adffc2591c0 (diff)
downloadQt-dbd27a3703905a2b48294b63a79b3a92456076b3.zip
Qt-dbd27a3703905a2b48294b63a79b3a92456076b3.tar.gz
Qt-dbd27a3703905a2b48294b63a79b3a92456076b3.tar.bz2
Another test for Loader.
Or rather, a potential test if this were possible. It may be possible in the future, so keep the test.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qmlgraphicsloader/tst_qmlgraphicsloader.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/auto/declarative/qmlgraphicsloader/tst_qmlgraphicsloader.cpp b/tests/auto/declarative/qmlgraphicsloader/tst_qmlgraphicsloader.cpp
index a5f769e..b1e76e1 100644
--- a/tests/auto/declarative/qmlgraphicsloader/tst_qmlgraphicsloader.cpp
+++ b/tests/auto/declarative/qmlgraphicsloader/tst_qmlgraphicsloader.cpp
@@ -77,8 +77,9 @@ private slots:
void sizeLoaderToItem();
void sizeItemToLoader();
void noResize();
- void networkRequest();
+ void networkRequestUrl();
void failNetworkRequest();
+// void networkComponent();
private:
QmlEngine engine;
@@ -285,7 +286,7 @@ void tst_QmlGraphicsLoader::noResize()
QCOMPARE(rect->height(), 60.0);
}
-void tst_QmlGraphicsLoader::networkRequest()
+void tst_QmlGraphicsLoader::networkRequestUrl()
{
TestHTTPServer server(SERVER_PORT);
QVERIFY(server.isValid());
@@ -304,6 +305,37 @@ void tst_QmlGraphicsLoader::networkRequest()
delete loader;
}
+/* XXX Component waits until all dependencies are loaded. Is this actually possible?
+void tst_QmlGraphicsLoader::networkComponent()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory("slowdata", TestHTTPServer::Delay);
+
+ QmlComponent component(&engine, QByteArray(
+ "import Qt 4.6\n"
+ "import \"http://127.0.0.1:14445/\" as NW\n"
+ "Item {\n"
+ " Component { id: comp; NW.SlowRect {} }\n"
+ " Loader { sourceComponent: comp } }")
+ , TEST_FILE(""));
+
+ QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(component.create());
+ QVERIFY(item);
+
+ QmlGraphicsLoader *loader = qobject_cast<QmlGraphicsLoader*>(item->QGraphicsObject::children().at(1));
+ QVERIFY(loader);
+ TRY_WAIT(loader->status() == QmlGraphicsLoader::Ready);
+
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(loader->status(), QmlGraphicsLoader::Ready);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ delete loader;
+}
+*/
+
void tst_QmlGraphicsLoader::failNetworkRequest()
{
TestHTTPServer server(SERVER_PORT);