summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/network/access/qnetworkreply
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-21 01:00:10 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-22 15:28:01 +0200
commitefd7757154e1fb946a51c7d90b8cbf56b4df8b6d (patch)
treef757e14770d82ee8376fa10006973c0e750b1e16 /tests/benchmarks/network/access/qnetworkreply
parent1c80d056e4f45b4ee7c4863cd792e83c889513c5 (diff)
parente10e5318bc02a48a866b76b6f0b7f268d16af642 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
Diffstat (limited to 'tests/benchmarks/network/access/qnetworkreply')
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 95ee094f00..559ed82834 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -31,6 +31,7 @@
#include <qtest.h>
#include <QtTest/QtTest>
#include <QtCore/qrandom.h>
+#include <QtCore/QElapsedTimer>
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkaccessmanager.h>
@@ -93,7 +94,7 @@ protected:
QEventLoop eventLoop;
QTimer::singleShot(timeout, &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
disconnect(client, SIGNAL(bytesWritten(qint64)), this, 0);
@@ -187,7 +188,7 @@ protected:
DataReader reader(client, false);
QObject::connect(client, SIGNAL(disconnected()), &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
qint64 elapsed = timer.elapsed();
@@ -280,7 +281,7 @@ protected:
DataReader reader(client, false);
QObject::connect(client, SIGNAL(disconnected()), &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
qint64 elapsed = timer.elapsed();
@@ -611,7 +612,7 @@ void tst_qnetworkreply::downloadPerformance()
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply, false);
- QTime loopTime;
+ QElapsedTimer loopTime;
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
loopTime.start();
QTestEventLoop::instance().enterLoop(40);
@@ -654,7 +655,7 @@ void tst_qnetworkreply::httpUploadPerformance()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTime time;
+ QElapsedTimer time;
generator.start();
time.start();
QTestEventLoop::instance().enterLoop(40);
@@ -682,7 +683,7 @@ void tst_qnetworkreply::performanceControlRate()
sink.connectToHost("127.0.0.1", sender.serverPort());
DataReader reader(&sink, false);
- QTime loopTime;
+ QElapsedTimer loopTime;
connect(&sink, SIGNAL(disconnected()), &QTestEventLoop::instance(), SLOT(exitLoop()));
loopTime.start();
QTestEventLoop::instance().enterLoop(40);
@@ -720,7 +721,7 @@ void tst_qnetworkreply::httpDownloadPerformance()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
HttpDownloadPerformanceClient client(reply.data());
- QTime time;
+ QElapsedTimer time;
time.start();
QTestEventLoop::instance().enterLoop(40);
QCOMPARE(reply->error(), QNetworkReply::NoError);