diff options
Diffstat (limited to 'tests/auto/network/access/http2/tst_http2.cpp')
-rw-r--r-- | tests/auto/network/access/http2/tst_http2.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index ecf4c5814a..49daedf32c 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -110,8 +110,7 @@ private: QThread *workerThread = nullptr; QNetworkAccessManager manager; - QEventLoop eventLoop; - QTimer timer; + QTestEventLoop eventLoop; int nRequests = 0; int nSentRequests = 0; @@ -133,8 +132,10 @@ struct ServerDeleter { static void cleanup(Http2Server *srv) { - if (srv) + if (srv) { + srv->stopSendingDATAFrames(); QMetaObject::invokeMethod(srv, "deleteLater", Qt::QueuedConnection); + } } }; @@ -146,11 +147,6 @@ tst_Http2::tst_Http2() : workerThread(new QThread) { workerThread->start(); - - timer.setInterval(10000); - timer.setSingleShot(true); - - connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit())); } tst_Http2::~tst_Http2() @@ -497,15 +493,12 @@ void tst_Http2::clearHTTP2State() void tst_Http2::runEventLoop(int ms) { - timer.setInterval(ms); - timer.start(); - eventLoop.exec(); + eventLoop.enterLoopMSecs(ms); } void tst_Http2::stopEventLoop() { - timer.stop(); - eventLoop.quit(); + eventLoop.exitLoop(); } Http2Server *tst_Http2::newServer(const Http2::RawSettings &serverSettings, |