summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-13 09:34:23 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-13 09:34:23 (GMT)
commitece530b88059cdfb166a99bba95ef4b70ce4ec66 (patch)
tree7af49213a328dfb6a09fbac8f27334d0737430b4 /tests/auto
parent6b84baddfb5187219b76d0d9a112db27bee29d2c (diff)
parentf7a1117cbec5638e32ea04b6a93412b193e07913 (diff)
downloadQt-ece530b88059cdfb166a99bba95ef4b70ce4ec66.zip
Qt-ece530b88059cdfb166a99bba95ef4b70ce4ec66.tar.gz
Qt-ece530b88059cdfb166a99bba95ef4b70ce4ec66.tar.bz2
Merge commit 'coreteam/4.6' into oslo1-4.6
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp12
-rw-r--r--tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp3
-rw-r--r--tests/auto/qdbusinterface/tst_qdbusinterface.cpp3
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp43
4 files changed, 54 insertions, 7 deletions
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index a09d998..f13bcad 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -80,6 +80,9 @@ private slots:
void httpProxyNtlmAuth();
void socks5Proxy();
void socks5ProxyAuth();
+
+ // ssl supported test
+ void supportsSsl();
};
class Chat
@@ -717,5 +720,14 @@ void tst_NetworkSelfTest::socks5ProxyAuth()
);
}
+void tst_NetworkSelfTest::supportsSsl()
+{
+#ifdef QT_NO_OPENSSL
+ QFAIL("SSL not compiled in");
+#else
+ QVERIFY(QSslSocket::supportsSsl());
+#endif
+}
+
QTEST_MAIN(tst_NetworkSelfTest)
#include "tst_networkselftest.moc"
diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 91050f5..a2c4758 100644
--- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -133,7 +133,7 @@ tst_QDBusAbstractInterface::tst_QDBusAbstractInterface()
void tst_QDBusAbstractInterface::initTestCase()
{
// enable debugging temporarily:
- putenv("QDBUS_DEBUG=1");
+ //putenv("QDBUS_DEBUG=1");
// register the object
QDBusConnection con = QDBusConnection::sessionBus();
@@ -465,6 +465,7 @@ void tst_QDBusAbstractInterface::followSignal()
QDBusConnectionInterface::DontAllowReplacement);
QVERIFY(r.isValid() && r.value() == QDBusConnectionInterface::ServiceRegistered);
QVERIFY(con.interface()->isServiceRegistered(serviceToFollow));
+ QCoreApplication::instance()->processEvents();
// emit the signal again:
emit targetObj.voidSignal();
diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
index 62d6342..bcd5bd9 100644
--- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
@@ -234,6 +234,7 @@ void tst_QDBusInterface::notValid()
void tst_QDBusInterface::invalidAfterServiceOwnerChanged()
{
+ // this test is technically the same as tst_QDBusAbstractInterface::followSignal
QDBusConnection conn = QDBusConnection::sessionBus();
QDBusConnectionInterface *connIface = conn.interface();
@@ -249,7 +250,7 @@ void tst_QDBusInterface::invalidAfterServiceOwnerChanged()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(!invalidInterface.isValid());
+ QVERIFY(invalidInterface.isValid());
}
void tst_QDBusInterface::introspect()
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 0b61dcd..bd83c47 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -225,6 +225,9 @@ private Q_SLOTS:
void ioPostToHttpUploadProgress();
void ioPostToHttpEmtpyUploadProgress();
+ void lastModifiedHeaderForFile();
+ void lastModifiedHeaderForHttp();
+
void rateControl_data();
void rateControl();
@@ -2619,12 +2622,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocket()
QSignalSpy authenticationRequiredSpy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
QSignalSpy proxyAuthenticationRequiredSpy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-#ifdef Q_OS_SYMBIAN
QTestEventLoop::instance().enterLoop(6);
-#else
- QTestEventLoop::instance().enterLoop(3);
-#endif
-
disconnect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
@@ -2969,6 +2967,41 @@ void tst_QNetworkReply::ioPostToHttpEmtpyUploadProgress()
server.close();
}
+void tst_QNetworkReply::lastModifiedHeaderForFile()
+{
+ QFileInfo fileInfo(SRCDIR "./bigfile");
+ QUrl url = QUrl::fromLocalFile(fileInfo.filePath());
+
+ QNetworkRequest request(url);
+ QNetworkReplyPtr reply = manager.head(request);
+ QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QDateTime header = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime();
+ QCOMPARE(header, fileInfo.lastModified());
+}
+
+void tst_QNetworkReply::lastModifiedHeaderForHttp()
+{
+ // Tue, 22 May 2007 12:04:57 GMT according to webserver
+ QUrl url = "http://" + QtNetworkSettings::serverName() + "/gif/fluke.gif";
+
+ QNetworkRequest request(url);
+ QNetworkReplyPtr reply = manager.head(request);
+ QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QDateTime header = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime();
+ QDateTime realDate = QDateTime::fromString("2007-05-22T12:04:57", Qt::ISODate);
+ realDate.setTimeSpec(Qt::UTC);
+
+ QCOMPARE(header, realDate);
+}
+
void tst_QNetworkReply::rateControl_data()
{
QTest::addColumn<int>("rate");