mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 00:35:27 +08:00
qt 6.6.0 clean
This commit is contained in:
@ -21,6 +21,8 @@
|
||||
#include <QtNetwork/private/qhostinfo_p.h>
|
||||
#endif
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
Q_DECLARE_METATYPE(QSharedPointer<char>)
|
||||
|
||||
class TimedSender: public QThread
|
||||
@ -456,7 +458,7 @@ void tst_qnetworkreply::httpLatency()
|
||||
QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/"));
|
||||
QNetworkReply* reply = manager.get(request);
|
||||
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
|
||||
QTestEventLoop::instance().enterLoop(5);
|
||||
QTestEventLoop::instance().enterLoop(5s);
|
||||
QVERIFY(!QTestEventLoop::instance().timeout());
|
||||
delete reply;
|
||||
}
|
||||
@ -470,7 +472,7 @@ QPair<QNetworkReply *, qint64> tst_qnetworkreply::runGetRequest(
|
||||
QNetworkReply *reply = manager->get(request);
|
||||
connect(reply, SIGNAL(sslErrors(QList<QSslError>)), reply, SLOT(ignoreSslErrors()));
|
||||
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
|
||||
QTestEventLoop::instance().enterLoop(20);
|
||||
QTestEventLoop::instance().enterLoop(20s);
|
||||
qint64 elapsed = timer.elapsed();
|
||||
return qMakePair(reply, elapsed);
|
||||
}
|
||||
@ -501,7 +503,7 @@ void tst_qnetworkreply::echoPerformance()
|
||||
QNetworkReply* reply = manager.post(request, data);
|
||||
connect(reply, SIGNAL(sslErrors(QList<QSslError>)), reply, SLOT(ignoreSslErrors()));
|
||||
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
|
||||
QTestEventLoop::instance().enterLoop(5);
|
||||
QTestEventLoop::instance().enterLoop(5s);
|
||||
QVERIFY(!QTestEventLoop::instance().timeout());
|
||||
QVERIFY(reply->error() == QNetworkReply::NoError);
|
||||
delete reply;
|
||||
@ -510,7 +512,7 @@ void tst_qnetworkreply::echoPerformance()
|
||||
|
||||
void tst_qnetworkreply::preConnectEncrypted()
|
||||
{
|
||||
QFETCH(int, sleepTime);
|
||||
QFETCH(std::chrono::milliseconds, sleepTime);
|
||||
QString hostName = QLatin1String("www.google.com");
|
||||
|
||||
QNetworkAccessManager manager;
|
||||
@ -541,7 +543,7 @@ void tst_qnetworkreply::preConnectEncrypted()
|
||||
|
||||
// now try to make the connection beforehand
|
||||
manager.connectToHostEncrypted(hostName);
|
||||
QTestEventLoop::instance().enterLoopMSecs(sleepTime);
|
||||
QTestEventLoop::instance().enterLoop(sleepTime);
|
||||
|
||||
// now make another request and hopefully use the existing connection
|
||||
QPair<QNetworkReply *, qint64> preConnectResult = runGetRequest(&manager, request);
|
||||
@ -559,12 +561,12 @@ void tst_qnetworkreply::preConnectEncrypted()
|
||||
void tst_qnetworkreply::preConnectEncrypted_data()
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
QTest::addColumn<int>("sleepTime");
|
||||
QTest::addColumn<std::chrono::milliseconds>("sleepTime");
|
||||
// start a new normal request after preconnecting is done
|
||||
QTest::newRow("HTTPS-2secs") << 2000;
|
||||
QTest::newRow("HTTPS-2secs") << 2000ms;
|
||||
|
||||
// start a new normal request while preconnecting is in-flight
|
||||
QTest::newRow("HTTPS-100ms") << 100;
|
||||
QTest::newRow("HTTPS-100ms") << 100ms;
|
||||
#endif // QT_NO_OPENSSL
|
||||
}
|
||||
|
||||
@ -915,9 +917,9 @@ void tst_qnetworkreply::preConnect()
|
||||
manager.clearAccessCache();
|
||||
|
||||
// now try to make the connection beforehand
|
||||
QFETCH(int, sleepTime);
|
||||
QFETCH(std::chrono::milliseconds, sleepTime);
|
||||
manager.connectToHost(hostName);
|
||||
QTestEventLoop::instance().enterLoopMSecs(sleepTime);
|
||||
QTestEventLoop::instance().enterLoop(sleepTime);
|
||||
|
||||
// now make another request and hopefully use the existing connection
|
||||
QPair<QNetworkReply *, qint64> preConnectResult = runGetRequest(&manager, request);
|
||||
|
Reference in New Issue
Block a user