QWebSocket should remember close code and reason
[contrib/qtwebsockets.git] / tests / auto / qwebsocket / tst_qwebsocket.cpp
index 0d1a46d..0e04ce1 100644 (file)
@@ -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
 }