summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qwebsocket/tst_qwebsocket.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/qwebsocket/tst_qwebsocket.cpp
index aca25d0..2422012 100644
--- a/tests/auto/qwebsocket/tst_qwebsocket.cpp
+++ b/tests/auto/qwebsocket/tst_qwebsocket.cpp
@@ -140,6 +140,7 @@ private Q_SLOTS:
void tst_sendTextMessage();
void tst_sendBinaryMessage();
void tst_errorString();
+ void tst_openRequest();
#ifndef QT_NO_NETWORKPROXY
void tst_setProxy();
#endif
@@ -581,6 +582,27 @@ void tst_QWebSocket::tst_errorString()
QCOMPARE(socket.errorString(), QStringLiteral("Host not found"));
}
+void tst_QWebSocket::tst_openRequest()
+{
+ EchoServer echoServer;
+
+ QWebSocket socket;
+
+ QSignalSpy socketConnectedSpy(&socket, SIGNAL(connected()));
+
+ QUrl url = QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() +
+ QLatin1Char(':') + QString::number(echoServer.port()));
+ url.addQueryItem("queryitem", "with encoded characters");
+ QNetworkRequest req(url);
+ socket.open(req);
+
+ if (socketConnectedSpy.count() == 0)
+ QVERIFY(socketConnectedSpy.wait(500));
+ QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
+
+ socket.close();
+}
+
#ifndef QT_NO_NETWORKPROXY
void tst_QWebSocket::tst_setProxy()
{