summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-05 15:31:49 +0100
committerMarkus Goetz <Markus.Goetz@nokia.com>2011-05-09 13:16:24 +0200
commit9c1293283e02e11525325153f4b85a0a23bfef9f (patch)
tree2f291748b0e06bf7cfaa5cae439aa300b3550d4c /tests/auto/qnetworkreply
parente01faeb5c7308662c7d727a55ff5c54e23244716 (diff)
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 8e3ba2ac0b..6c77f11d03 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -4973,16 +4973,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