diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-11 16:09:41 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-11 16:10:19 (GMT) |
commit | e8f45c5ba8371053817f13e70d78b06f229d8666 (patch) | |
tree | 649406f173a5d4d0db0116ecd2e673ee0bacb103 /tests/auto/qhttp | |
parent | 56d0ea16af168167d840889f67948a79fac9a0d6 (diff) | |
download | Qt-e8f45c5ba8371053817f13e70d78b06f229d8666.zip Qt-e8f45c5ba8371053817f13e70d78b06f229d8666.tar.gz Qt-e8f45c5ba8371053817f13e70d78b06f229d8666.tar.bz2 |
Autotest: add a local version of the tst_QHttp::connectionClose test
Now it doesn't have to be manual any more.
Reviewed-by: Trust Me
Diffstat (limited to 'tests/auto/qhttp')
-rw-r--r-- | tests/auto/qhttp/tst_qhttp.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index 92ab3d8..bfd8ae9 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -114,9 +114,6 @@ private slots: void abortInReadyRead(); void abortInResponseHeaderReceived(); void nestedEventLoop(); - - - // manual tests void connectionClose(); protected slots: @@ -175,6 +172,23 @@ private: bool proxyAuthCalled; }; +class ClosingServer: public QTcpServer +{ + Q_OBJECT +public: + ClosingServer() + { + connect(this, SIGNAL(newConnection()), SLOT(handleConnection())); + listen(); + } + +public slots: + void handleConnection() + { + delete nextPendingConnection(); + } +}; + //#define DUMP_SIGNALS const int bytesTotal_init = -10; @@ -1491,20 +1505,14 @@ void tst_QHttp::abortInResponseHeaderReceived() void tst_QHttp::connectionClose() { - // This test tries to connect to a client's server, so it is disabled. - // Every now and then, someone please run it to make sure it's not broken. - // Note: the servers might change too... - // // This was added in response to bug 176822 -#ifndef Q_OS_SYMBIAN - QSKIP("This test is manual - read comments in the source code", SkipAll); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; QHttp http; - http.setHost("www.fon.com", QHttp::ConnectionModeHttps); + ClosingServer server; + http.setHost("localhost", QHttp::ConnectionModeHttps, server.serverPort()); http.get("/login/gateway/processLogin"); // another possibility: |