summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-05 14:31:49 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-05-05 14:38:26 (GMT)
commita1b150981d58276e7937c4e3daebea5ffe05c17d (patch)
treebdb65295790f129ab99d3a8cf6c3ad8bef00425e /tests/auto/qnetworkreply
parent5b356ab162c58442a5e08868412af1b2b65b3f5c (diff)
downloadQt-a1b150981d58276e7937c4e3daebea5ffe05c17d.zip
Qt-a1b150981d58276e7937c4e3daebea5ffe05c17d.tar.gz
Qt-a1b150981d58276e7937c4e3daebea5ffe05c17d.tar.bz2
fix tst_qnetworkreply::httpProxyCommands autotest
Due to architecture changes in Qt 4.8, clearing the proxy before the request is complete causes the http connection to not use any proxy. The issue is that the proxy isn't resolved until after the bearer has been started (which is correct in the general case, as system proxy is unknown until that time). Also increased the test's timeout from 1 second to 15, as starting a bearer can be slow. Reviewed-by: Markus Goetz
Diffstat (limited to 'tests/auto/qnetworkreply')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 18b2177..cbd6163 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -4967,16 +4967,21 @@ void tst_QNetworkReply::httpProxyCommands()
QNetworkRequest request(url);
request.setRawHeader("User-Agent", "QNetworkReplyAutoTest/1.0");
QNetworkReplyPtr reply = manager.get(request);
- manager.setProxy(QNetworkProxy());
+ //clearing the proxy here causes the test to fail.
+ //the proxy isn't used until after the bearer has been started
+ //which is correct in general, because system proxy isn't known until that time.
+ //removing this line is safe, as the proxy is also reset by the cleanup() function
+ //manager.setProxy(QNetworkProxy());
// wait for the finished signal
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(1);
+ QTestEventLoop::instance().enterLoop(15);
QVERIFY(!QTestEventLoop::instance().timeout());
//qDebug() << reply->error() << reply->errorString();
+ //qDebug() << proxyServer.receivedData;
// we don't really care if the request succeeded
// especially since it won't succeed in the HTTPS case