summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-05-08 20:43:45 +0200
committerLiang Qi <liang.qi@qt.io>2018-05-08 20:43:45 +0200
commitb5a956601f369e961d6863126f8facc61bb6df1f (patch)
tree25e4021518b254ef76c410244dd6581432bf285f /tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
parent290f953253afc5935382525cd4b72e091865cab5 (diff)
parent1b7337d23dbc767ba482d9051180f10d77052913 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
Diffstat (limited to 'tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 69bd78a4f0..0ef3dc0b61 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -7816,13 +7816,14 @@ void tst_QNetworkReply::closeDuringDownload()
QFETCH(QUrl, url);
QNetworkRequest request(url);
QNetworkReply* reply = manager.get(request);
- connect(reply, SIGNAL(readyRead()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
- QVERIFY(!QTestEventLoop::instance().timeout());
- connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QSignalSpy readyReadSpy(reply, &QNetworkReply::readyRead);
+ QVERIFY(readyReadSpy.wait(10000));
+ QSignalSpy destroySpy(reply, &QObject::destroyed);
reply->close();
reply->deleteLater();
- QTest::qWait(1000); //cancelling ftp takes some time, this avoids a warning caused by test's cleanup() destroying the connection cache before the abort is finished
+ // Wait for destruction to avoid a warning caused by test's cleanup()
+ // destroying the connection cache before the abort is finished
+ QVERIFY(destroySpy.wait());
}
void tst_QNetworkReply::ftpAuthentication_data()