diff options
Diffstat (limited to 'tests/auto/qhttp/tst_qhttp.cpp')
-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 59bfb15..320225d 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: |