summaryrefslogtreecommitdiff
path: root/tests/auto/qwebsocket/tst_qwebsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qwebsocket/tst_qwebsocket.cpp')
-rw-r--r--tests/auto/qwebsocket/tst_qwebsocket.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/qwebsocket/tst_qwebsocket.cpp
index 9e5997e..529efa3 100644
--- a/tests/auto/qwebsocket/tst_qwebsocket.cpp
+++ b/tests/auto/qwebsocket/tst_qwebsocket.cpp
@@ -147,6 +147,7 @@ private Q_SLOTS:
void tst_sendTextMessage();
void tst_sendBinaryMessage();
void tst_errorString();
+ void tst_setProxy();
};
tst_QWebSocket::tst_QWebSocket()
@@ -575,6 +576,23 @@ void tst_QWebSocket::tst_errorString()
QCOMPARE(socket.errorString(), QStringLiteral("Host not found"));
}
+void tst_QWebSocket::tst_setProxy()
+{
+ // check if property assignment works as expected.
+ QWebSocket socket;
+ QCOMPARE(socket.proxy(), QNetworkProxy(QNetworkProxy::DefaultProxy));
+
+ QNetworkProxy proxy;
+ proxy.setPort(123);
+ socket.setProxy(proxy);
+ QCOMPARE(socket.proxy(), proxy);
+
+ proxy.setPort(321);
+ QCOMPARE(socket.proxy().port(), quint16(123));
+ socket.setProxy(proxy);
+ QCOMPARE(socket.proxy(), proxy);
+}
+
QTEST_MAIN(tst_QWebSocket)
#include "tst_qwebsocket.moc"