summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro17
-rw-r--r--tests/auto/qml/qml.pro3
-rw-r--r--tests/auto/qml/qmlwebsockets/qmlwebsockets.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml53
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro9
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp35
-rw-r--r--tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml52
-rw-r--r--tests/auto/websockets/dataprocessor/dataprocessor.pro (renamed from tests/auto/dataprocessor/dataprocessor.pro)0
-rw-r--r--tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp (renamed from tests/auto/dataprocessor/tst_dataprocessor.cpp)12
-rw-r--r--tests/auto/websockets/handshakerequest/handshakerequest.pro (renamed from tests/auto/handshakerequest/handshakerequest.pro)0
-rw-r--r--tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp (renamed from tests/auto/handshakerequest/tst_handshakerequest.cpp)12
-rw-r--r--tests/auto/websockets/handshakeresponse/handshakeresponse.pro (renamed from tests/auto/handshakeresponse/handshakeresponse.pro)0
-rw-r--r--tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp (renamed from tests/auto/handshakeresponse/tst_handshakeresponse.cpp)34
-rw-r--r--tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro (renamed from tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro)0
-rw-r--r--tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp (renamed from tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp)12
-rw-r--r--tests/auto/websockets/qwebsocket/qwebsocket.pro (renamed from tests/auto/qwebsocket/qwebsocket.pro)0
-rw-r--r--tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp (renamed from tests/auto/qwebsocket/tst_qwebsocket.cpp)44
-rw-r--r--tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro (renamed from tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro)0
-rw-r--r--tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp (renamed from tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp)12
-rw-r--r--tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro (renamed from tests/auto/qwebsocketserver/qwebsocketserver.pro)0
-rw-r--r--tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp (renamed from tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp)12
-rw-r--r--tests/auto/websockets/websocketframe/tst_websocketframe.cpp (renamed from tests/auto/websocketframe/tst_websocketframe.cpp)12
-rw-r--r--tests/auto/websockets/websocketframe/websocketframe.pro (renamed from tests/auto/websocketframe/websocketframe.pro)0
-rw-r--r--tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp (renamed from tests/auto/websocketprotocol/tst_websocketprotocol.cpp)12
-rw-r--r--tests/auto/websockets/websocketprotocol/websocketprotocol.pro (renamed from tests/auto/websocketprotocol/websocketprotocol.pro)0
-rw-r--r--tests/auto/websockets/websockets.pro16
27 files changed, 298 insertions, 93 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4698cd0..d96c4a5 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,16 +1,7 @@
TEMPLATE = subdirs
-SUBDIRS = \
- qwebsocketcorsauthenticator
+SUBDIRS += cmake websockets
-contains(QT_CONFIG, private_tests): SUBDIRS += \
- websocketprotocol \
- dataprocessor \
- websocketframe \
- handshakerequest \
- handshakeresponse \
- qdefaultmaskgenerator
-
-SUBDIRS += \
- qwebsocket \
- qwebsocketserver
+qtHaveModule(quick) {
+ SUBDIRS += qml
+}
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
new file mode 100644
index 0000000..24941ad
--- /dev/null
+++ b/tests/auto/qml/qml.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS += qmlwebsockets qmlwebsockets_compat
diff --git a/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
new file mode 100644
index 0000000..9405f37
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/qmlwebsockets.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
new file mode 100644
index 0000000..c230bf5
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets)
diff --git a/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
new file mode 100644
index 0000000..8c721a5
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets/tst_qmlwebsockets.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtWebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ port: 1337
+ }
+
+ WebSocket {
+ id: socket
+ }
+}
diff --git a/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
new file mode 100644
index 0000000..104e6de
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/qmlwebsockets_compat.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_qmlwebsockets_compat
+CONFIG += qmltestcase
+CONFIG += console
+SOURCES += tst_qmlwebsockets_compat.cpp
+
+importFiles.path = .
+DEPLOYMENT += importFiles
+
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
new file mode 100644
index 0000000..0ce5bce
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.cpp
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQuickTest/quicktest.h>
+QUICK_TEST_MAIN(qmlwebsockets_compat)
diff --git a/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
new file mode 100644
index 0000000..fa2a992
--- /dev/null
+++ b/tests/auto/qml/qmlwebsockets_compat/tst_qmlwebsockets_compat.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import Qt.WebSockets 1.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ function appendMessage(message) {
+ messageBox.text += "\n" + message
+ }
+
+ WebSocketServer {
+ id: server
+ }
+
+ WebSocket {
+ id: socket
+ }
+}
diff --git a/tests/auto/dataprocessor/dataprocessor.pro b/tests/auto/websockets/dataprocessor/dataprocessor.pro
index ac5ba5c..ac5ba5c 100644
--- a/tests/auto/dataprocessor/dataprocessor.pro
+++ b/tests/auto/websockets/dataprocessor/dataprocessor.pro
diff --git a/tests/auto/dataprocessor/tst_dataprocessor.cpp b/tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp
index 63fd0e0..660d8eb 100644
--- a/tests/auto/dataprocessor/tst_dataprocessor.cpp
+++ b/tests/auto/websockets/dataprocessor/tst_dataprocessor.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/handshakerequest/handshakerequest.pro b/tests/auto/websockets/handshakerequest/handshakerequest.pro
index d887cd6..d887cd6 100644
--- a/tests/auto/handshakerequest/handshakerequest.pro
+++ b/tests/auto/websockets/handshakerequest/handshakerequest.pro
diff --git a/tests/auto/handshakerequest/tst_handshakerequest.cpp b/tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp
index 619a477..9c579bd 100644
--- a/tests/auto/handshakerequest/tst_handshakerequest.cpp
+++ b/tests/auto/websockets/handshakerequest/tst_handshakerequest.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/handshakeresponse/handshakeresponse.pro b/tests/auto/websockets/handshakeresponse/handshakeresponse.pro
index 4d7cd50..4d7cd50 100644
--- a/tests/auto/handshakeresponse/handshakeresponse.pro
+++ b/tests/auto/websockets/handshakeresponse/handshakeresponse.pro
diff --git a/tests/auto/handshakeresponse/tst_handshakeresponse.cpp b/tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp
index 673fa17..b5f103b 100644
--- a/tests/auto/handshakeresponse/tst_handshakeresponse.cpp
+++ b/tests/auto/websockets/handshakeresponse/tst_handshakeresponse.cpp
@@ -1,40 +1,32 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL$
+** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro b/tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro
index 3a951a7..3a951a7 100644
--- a/tests/auto/qdefaultmaskgenerator/qdefaultmaskgenerator.pro
+++ b/tests/auto/websockets/qdefaultmaskgenerator/qdefaultmaskgenerator.pro
diff --git a/tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp b/tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp
index ee94d5a..f5fc5c4 100644
--- a/tests/auto/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp
+++ b/tests/auto/websockets/qdefaultmaskgenerator/tst_defaultmaskgenerator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/qwebsocket/qwebsocket.pro b/tests/auto/websockets/qwebsocket/qwebsocket.pro
index 0155d08..0155d08 100644
--- a/tests/auto/qwebsocket/qwebsocket.pro
+++ b/tests/auto/websockets/qwebsocket/qwebsocket.pro
diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
index 29ba7a3..aca25d0 100644
--- a/tests/auto/qwebsocket/tst_qwebsocket.cpp
+++ b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -50,6 +50,9 @@ public:
QHostAddress hostAddress() const { return m_pWebSocketServer->serverAddress(); }
quint16 port() const { return m_pWebSocketServer->serverPort(); }
+Q_SIGNALS:
+ void newConnection(QUrl requestUrl);
+
private Q_SLOTS:
void onNewConnection();
void processTextMessage(QString message);
@@ -67,7 +70,7 @@ EchoServer::EchoServer(QObject *parent) :
QWebSocketServer::NonSecureMode, this)),
m_clients()
{
- if (m_pWebSocketServer->listen()) {
+ if (m_pWebSocketServer->listen(QHostAddress(QStringLiteral("127.0.0.1")))) {
connect(m_pWebSocketServer, SIGNAL(newConnection()),
this, SLOT(onNewConnection()));
}
@@ -83,6 +86,8 @@ void EchoServer::onNewConnection()
{
QWebSocket *pSocket = m_pWebSocketServer->nextPendingConnection();
+ Q_EMIT newConnection(pSocket->requestUrl());
+
connect(pSocket, SIGNAL(textMessageReceived(QString)), this, SLOT(processTextMessage(QString)));
connect(pSocket, SIGNAL(binaryMessageReceived(QByteArray)), this, SLOT(processBinaryMessage(QByteArray)));
connect(pSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
@@ -398,8 +403,6 @@ void tst_QWebSocket::tst_invalidOrigin()
void tst_QWebSocket::tst_sendTextMessage()
{
- //TODO: will resolve in another commit
-#ifndef Q_OS_WIN
EchoServer echoServer;
QWebSocket socket;
@@ -408,17 +411,28 @@ void tst_QWebSocket::tst_sendTextMessage()
QCOMPARE(socket.sendTextMessage(QStringLiteral("1234")), 0);
QSignalSpy socketConnectedSpy(&socket, SIGNAL(connected()));
+ QSignalSpy serverConnectedSpy(&echoServer, SIGNAL(newConnection(QUrl)));
QSignalSpy textMessageReceived(&socket, SIGNAL(textMessageReceived(QString)));
QSignalSpy textFrameReceived(&socket, SIGNAL(textFrameReceived(QString,bool)));
QSignalSpy binaryMessageReceived(&socket, SIGNAL(binaryMessageReceived(QByteArray)));
QSignalSpy binaryFrameReceived(&socket, SIGNAL(binaryFrameReceived(QByteArray,bool)));
+ QSignalSpy socketError(&socket, SIGNAL(error(QAbstractSocket::SocketError)));
- socket.open(QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() +
- QStringLiteral(":") + QString::number(echoServer.port())));
+ QUrl url = QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() +
+ QStringLiteral(":") + QString::number(echoServer.port()));
+ url.setPath("/segment/with spaces");
+ url.addQueryItem("queryitem", "with encoded characters");
+
+ socket.open(url);
if (socketConnectedSpy.count() == 0)
QVERIFY(socketConnectedSpy.wait(500));
+ QCOMPARE(socketError.count(), 0);
QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(serverConnectedSpy.count(), 1);
+ QList<QVariant> arguments = serverConnectedSpy.takeFirst();
+ QUrl urlConnected = arguments.at(0).toUrl();
+ QCOMPARE(urlConnected, url);
socket.sendTextMessage(QStringLiteral("Hello world!"));
@@ -426,7 +440,7 @@ void tst_QWebSocket::tst_sendTextMessage()
QCOMPARE(textMessageReceived.count(), 1);
QCOMPARE(binaryMessageReceived.count(), 0);
QCOMPARE(binaryFrameReceived.count(), 0);
- QList<QVariant> arguments = textMessageReceived.takeFirst();
+ arguments = textMessageReceived.takeFirst();
QString messageReceived = arguments.at(0).toString();
QCOMPARE(messageReceived, QStringLiteral("Hello world!"));
@@ -472,13 +486,10 @@ void tst_QWebSocket::tst_sendTextMessage()
socket.close(QWebSocketProtocol::CloseCodeGoingAway, reason);
QCOMPARE(socket.closeCode(), QWebSocketProtocol::CloseCodeGoingAway);
QCOMPARE(socket.closeReason(), reason);
-#endif
}
void tst_QWebSocket::tst_sendBinaryMessage()
{
- //TODO: will resolve in another commit
-#ifndef Q_OS_WIN
EchoServer echoServer;
QWebSocket socket;
@@ -546,7 +557,6 @@ void tst_QWebSocket::tst_sendBinaryMessage()
isLastFrame = arguments.at(1).toBool();
QCOMPARE(frameReceived, QByteArrayLiteral("Hello world!"));
QVERIFY(isLastFrame);
-#endif
}
void tst_QWebSocket::tst_errorString()
@@ -562,7 +572,7 @@ void tst_QWebSocket::tst_errorString()
socket.open(QUrl(QStringLiteral("ws://someserver.on.mars:9999")));
if (errorSpy.count() == 0)
- errorSpy.wait();
+ errorSpy.wait(500);
QCOMPARE(errorSpy.count(), 1);
QList<QVariant> arguments = errorSpy.takeFirst();
QAbstractSocket::SocketError socketError =
diff --git a/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro b/tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro
index aa485fc..aa485fc 100644
--- a/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro
+++ b/tests/auto/websockets/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro
diff --git a/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp b/tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp
index 773179c..225adc8 100644
--- a/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp
+++ b/tests/auto/websockets/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/qwebsocketserver/qwebsocketserver.pro b/tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro
index 25216d3..25216d3 100644
--- a/tests/auto/qwebsocketserver/qwebsocketserver.pro
+++ b/tests/auto/websockets/qwebsocketserver/qwebsocketserver.pro
diff --git a/tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
index 8ee0a36..c2ba842 100644
--- a/tests/auto/qwebsocketserver/tst_qwebsocketserver.cpp
+++ b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/websocketframe/tst_websocketframe.cpp b/tests/auto/websockets/websocketframe/tst_websocketframe.cpp
index dd1ab5f..5db82d5 100644
--- a/tests/auto/websocketframe/tst_websocketframe.cpp
+++ b/tests/auto/websockets/websocketframe/tst_websocketframe.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/websocketframe/websocketframe.pro b/tests/auto/websockets/websocketframe/websocketframe.pro
index 9682348..9682348 100644
--- a/tests/auto/websocketframe/websocketframe.pro
+++ b/tests/auto/websockets/websocketframe/websocketframe.pro
diff --git a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp b/tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp
index 222d1fe..94816de 100644
--- a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp
+++ b/tests/auto/websockets/websocketprotocol/tst_websocketprotocol.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
-** Contact: http://www.qt-project.org/legal
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
diff --git a/tests/auto/websocketprotocol/websocketprotocol.pro b/tests/auto/websockets/websocketprotocol/websocketprotocol.pro
index c21bb64..c21bb64 100644
--- a/tests/auto/websocketprotocol/websocketprotocol.pro
+++ b/tests/auto/websockets/websocketprotocol/websocketprotocol.pro
diff --git a/tests/auto/websockets/websockets.pro b/tests/auto/websockets/websockets.pro
new file mode 100644
index 0000000..4698cd0
--- /dev/null
+++ b/tests/auto/websockets/websockets.pro
@@ -0,0 +1,16 @@
+TEMPLATE = subdirs
+
+SUBDIRS = \
+ qwebsocketcorsauthenticator
+
+contains(QT_CONFIG, private_tests): SUBDIRS += \
+ websocketprotocol \
+ dataprocessor \
+ websocketframe \
+ handshakerequest \
+ handshakeresponse \
+ qdefaultmaskgenerator
+
+SUBDIRS += \
+ qwebsocket \
+ qwebsocketserver