summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@digia.com>2010-10-21 09:26:31 (GMT)
committerJanne Koskinen <janne.p.koskinen@digia.com>2010-10-21 09:26:31 (GMT)
commit7e7bf0449d567c99882a37bb138221dfca9a3ed0 (patch)
tree2d84cfa02e5e5f97de79c3a148acb38ae7076b3d /tests
parent5102cf81c31ff59aca03273daab9d797eb818058 (diff)
parent5f49392232dff904fdd3401cb739a1eaa79f7bd3 (diff)
downloadQt-7e7bf0449d567c99882a37bb138221dfca9a3ed0.zip
Qt-7e7bf0449d567c99882a37bb138221dfca9a3ed0.tar.gz
Qt-7e7bf0449d567c99882a37bb138221dfca9a3ed0.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
index b20d8ec..50d0731 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
+++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
@@ -74,7 +74,7 @@ private slots:
void massive();
void cancelcrash();
void shrinkcache();
-
+ void networkCrash();
private:
QDeclarativeEngine engine;
QUrl thisfile;
@@ -335,6 +335,7 @@ public:
: QDeclarativeImageProvider(Pixmap) {}
virtual QPixmap requestPixmap(const QString &d, QSize *, const QSize &) {
+ Q_UNUSED(d)
QPixmap pix(800, 600);
pix.fill(Qt::red);
return pix;
@@ -353,6 +354,30 @@ void tst_qdeclarativepixmapcache::shrinkcache()
}
}
+void createNetworkServer()
+{
+ QEventLoop eventLoop;
+ TestHTTPServer server(14453);
+ server.serveDirectory(SRCDIR "/data/http");
+ QTimer::singleShot(100, &eventLoop, SLOT(quit()));
+ eventLoop.exec();
+}
+
+// QT-3957
+void tst_qdeclarativepixmapcache::networkCrash()
+{
+ QFuture<void> future = QtConcurrent::run(createNetworkServer);
+ QDeclarativeEngine engine;
+ for (int ii = 0; ii < 100 ; ++ii) {
+ QDeclarativePixmap* pixmap = new QDeclarativePixmap;
+ pixmap->load(&engine, QUrl(QString("http://127.0.0.1:14453/exists.png")));
+ QTest::qSleep(1);
+ pixmap->clear();
+ delete pixmap;
+ }
+ future.cancel();
+}
+
QTEST_MAIN(tst_qdeclarativepixmapcache)
#include "tst_qdeclarativepixmapcache.moc"