diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-21 04:44:26 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-21 04:44:26 (GMT) |
commit | 8331e9700b830594d3c015308bf0aa351997862c (patch) | |
tree | c274362e2c6a236af96b6c78d7f8858a939439cb /tests | |
parent | 80f031dfca7c161de4461514dfd8d9d664ea2f03 (diff) | |
parent | 3170828ee142be248c1acdee4e6677a7238d6e56 (diff) | |
download | Qt-8331e9700b830594d3c015308bf0aa351997862c.zip Qt-8331e9700b830594d3c015308bf0aa351997862c.tar.gz Qt-8331e9700b830594d3c015308bf0aa351997862c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Fix network request completion crashing on a canceled pixmap request
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp | 27 |
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" |