summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-03 20:58:24 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-03 20:58:24 (GMT)
commitab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e (patch)
treeeaf8d4c7f886f463b22c17d27352829728d95fc8 /tests/auto
parent671eb89e41c90cc4cb11eca1c76181d1186db2b2 (diff)
parentb37fa034257673a43783a54bb66328c82a0c7ef1 (diff)
downloadQt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.zip
Qt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.tar.gz
Qt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: The lastCenterPoint should be equal to centerPoint for new gestures. PinchGesture: lastRotationAngle should start at 0. tst_qnetworkreply: Add testcase for unknown authentication method QNAM: Reset authenticator state properly between requests msvc: enable unreferenced code elimination in release with debuginfo builds exclude headers in builddir from -copy option more elegant treatment of qconfig.h special case simplify recursive symlinking
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 5196ed2..8850e6e 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -295,6 +295,8 @@ private Q_SLOTS:
void getFromUnreachableIp();
+ void qtbug4121unknownAuthentication();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -4598,6 +4600,7 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply()
QCOMPARE(reply->error(), QNetworkReply::NoError);
}
+// TODO add similar test for FTP
void tst_QNetworkReply::getFromUnreachableIp()
{
QNetworkAccessManager manager;
@@ -4612,6 +4615,35 @@ void tst_QNetworkReply::getFromUnreachableIp()
QVERIFY(reply->error() != QNetworkReply::NoError);
}
+void tst_QNetworkReply::qtbug4121unknownAuthentication()
+{
+ MiniHttpServer server(QByteArray("HTTP/1.1 401 bla\r\nWWW-Authenticate: crap\r\nContent-Length: 0\r\n\r\n"));
+ server.doClose = false;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkAccessManager manager;
+ QNetworkReplyPtr reply = manager.get(request);
+
+ qRegisterMetaType<QNetworkReply*>("QNetworkReply*");
+ qRegisterMetaType<QAuthenticator*>("QAuthenticator*");
+ QSignalSpy authSpy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+ QSignalSpy finishedSpy(&manager, SIGNAL(finished(QNetworkReply*)));
+ qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");
+ QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError)));
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(authSpy.count(), 0);
+ QCOMPARE(finishedSpy.count(), 1);
+ QCOMPARE(errorSpy.count(), 1);
+
+ QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
+}
+
+
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{