summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-02 13:15:54 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-29 16:49:54 +0100
commit5f8093e6f985a7a887ffaa1e2fecd7314b5444c6 (patch)
tree20fe90121185373d1f561dcc04a61c6bd6766f8e /tests
parentdf320becb3d23ea99bf1ddfc190557e7a1729928 (diff)
downloadqtwebsockets-5f8093e6f985a7a887ffaa1e2fecd7314b5444c6.tar.gz
QWebSocket should remember close code and reasonv5.4.15.4.1
Task-number: QTBUG-42982 Change-Id: I50dbff96d7d64a5213e6ea6ba7bb9429b21b1fb2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qwebsocket/tst_qwebsocket.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/qwebsocket/tst_qwebsocket.cpp
index 0d1a46d..0e04ce1 100644
--- a/tests/auto/qwebsocket/tst_qwebsocket.cpp
+++ b/tests/auto/qwebsocket/tst_qwebsocket.cpp
@@ -471,6 +471,11 @@ void tst_QWebSocket::tst_sendTextMessage()
isLastFrame = arguments.at(1).toBool();
QCOMPARE(frameReceived, QStringLiteral("Hello world!"));
QVERIFY(isLastFrame);
+
+ QString reason = QStringLiteral("going away");
+ socket.close(QWebSocketProtocol::CloseCodeGoingAway, reason);
+ QCOMPARE(socket.closeCode(), QWebSocketProtocol::CloseCodeGoingAway);
+ QCOMPARE(socket.closeReason(), reason);
#endif
}