summaryrefslogtreecommitdiffstats
path: root/tests/auto/qhttpnetworkconnection
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-10-26 17:47:43 +0200
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-10-27 14:40:28 +0200
commit3d7e7b4595059c69428022e52b63b10edbe81b0f (patch)
tree93839243f0a71b74c5ffcb1da3343998f41a1df7 /tests/auto/qhttpnetworkconnection
parentfb404765a5af559598dc5b3906e45d8c5e48884b (diff)
QNAM HTTP: Move authenticationRequired() to QHttpNetworkReply
Reviewed-by: Prasanth Task-Number: QTBUG-13234
Diffstat (limited to 'tests/auto/qhttpnetworkconnection')
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index ecfd462ef6..0956b57e3d 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -57,7 +57,7 @@ public:
public Q_SLOTS:
void finishedReply();
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail);
- void challenge401(const QHttpNetworkReply*, const QHttpNetworkRequest &request, QAuthenticator *authenticator, const QHttpNetworkConnection *connection);
+ void challenge401(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
#ifndef QT_NO_OPENSSL
void sslErrors(const QList<QSslError> &errors);
#endif
@@ -495,15 +495,15 @@ void tst_QHttpNetworkConnection::_connect()
QVERIFY(false);
}
-void tst_QHttpNetworkConnection::challenge401(const QHttpNetworkReply*, const QHttpNetworkRequest &request,
- QAuthenticator *authenticator,
- const QHttpNetworkConnection *connection)
+void tst_QHttpNetworkConnection::challenge401(const QHttpNetworkRequest &request,
+ QAuthenticator *authenticator)
{
Q_UNUSED(request)
- Q_UNUSED(connection)
- QHttpNetworkConnection *c = qobject_cast<QHttpNetworkConnection*>(sender());
- if (connection) {
+ QHttpNetworkReply *reply = qobject_cast<QHttpNetworkReply*>(sender());
+ if (reply) {
+ QHttpNetworkConnection *c = reply->connection();
+
QVariant val = c->property("setCredentials");
if (val.toBool()) {
QVariant user = c->property("username");
@@ -552,14 +552,14 @@ void tst_QHttpNetworkConnection::get401()
if (encrypt)
connection.enableEncryption();
QCOMPARE(connection.isEncrypted(), encrypt);
- connect(&connection, SIGNAL(authenticationRequired(const QHttpNetworkReply*, const QHttpNetworkRequest&, QAuthenticator *, const QHttpNetworkConnection*)),
- SLOT(challenge401(const QHttpNetworkReply*, const QHttpNetworkRequest&, QAuthenticator *, const QHttpNetworkConnection*)));
connection.setProperty("setCredentials", setCredentials);
connection.setProperty("username", username);
connection.setProperty("password", password);
QHttpNetworkRequest request(protocol + host + path);
QHttpNetworkReply *reply = connection.sendRequest(request);
+ connect(reply, SIGNAL(authenticationRequired(const QHttpNetworkRequest&, QAuthenticator *)),
+ SLOT(challenge401(const QHttpNetworkRequest&, QAuthenticator *)));
finishedCalled = false;
finishedWithErrorCalled = false;