diff options
Diffstat (limited to 'tests/auto/network')
4 files changed, 13 insertions, 4 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 855b1f9041..e995b69f60 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -5773,6 +5773,15 @@ void tst_QNetworkReply::proxyChange() QNetworkRequest req(QUrl("http://" + QtNetworkSettings::serverName())); proxyServer.doClose = false; + { + // Needed to initialize a network session in QNAM. Without an initialized session the GET + // will be deferred until later, and the proxy will be unset first. This caused the test to + // fail in standalone runs (it passed in CI because the same QNAM instance is used for the + // entire test). + QNetworkReplyPtr temporary(manager.get(req)); + waitForFinish(temporary); + } + manager.setProxy(dummyProxy); QNetworkReplyPtr reply1(manager.get(req)); connect(reply1, SIGNAL(finished()), &helper, SLOT(finishedSlot())); diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST b/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST deleted file mode 100644 index 73570c98b7..0000000000 --- a/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[genericSystemProxy] -ubuntu-14.04 diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro index ed73e3e10e..a7fa43015f 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro +++ b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro @@ -4,6 +4,6 @@ CONFIG += testcase TARGET = tst_qnetworkproxyfactory -QT = core network testlib +QT = core network-private testlib SOURCES += tst_qnetworkproxyfactory.cpp diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 81d598641b..f3a1ac84ff 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -42,6 +42,8 @@ #include <QSysInfo> #include <QThread> +#include <private/qtnetworkglobal_p.h> + class tst_QNetworkProxyFactory : public QObject { Q_OBJECT @@ -255,7 +257,7 @@ void tst_QNetworkProxyFactory::genericSystemProxy() QFETCH(int, port); // The generic system proxy is only available on the following platforms -#if (!defined Q_OS_WIN) && (!defined Q_OS_OSX) +#if (!defined Q_OS_WIN) && (!defined Q_OS_OSX) && !QT_CONFIG(libproxy) qputenv(envVar, url); const QList<QNetworkProxy> systemProxy = QNetworkProxyFactory::systemProxyForQuery(); QCOMPARE(systemProxy.size(), 1); |