summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Address issues with test introduced with 401 supportMårten Nordheim2023-03-281-11/+15
| | | | | | | | | | | | | | The testing with Connection: Close wasn't necessarily testing it since it was relying on not having a Content-Length, but this did not work out as intended. And fix excluded code (#if 0), relies on an update in qtbase. On macOS the ST backend was having trouble with how we handled shutdown of socket and re-use. Amends da30f70fea239f723f1d36b076bb3f5860f50ed9 Change-Id: I8a19387b911eec522690d597d863c5bc0786e8c8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Revert "Blacklist two tests in handshakerequest"Edward Welbourne2023-01-201-5/+0
| | | | | | | | | | | | This reverts commit 9486a8053edd0eab68a03178effebda0d5194607. The bug that caused this has now been fixed, so presumably these tests should now be OK again. Change-Id: Ifed83aedccc32cdd68600f94c1b3c5b8d5c7c8b9 Pick-to: 6.2 6.4 6.5 Task-number: QTBUG-84315 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QWebSocket: style fix; drop unnecessary spaceMårten Nordheim2022-12-211-1/+1
| | | | | Change-Id: I0b4e65bb97e358aad85f41761d3bd2c64b313e62 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Support 401 response for websocket connectionsMårten Nordheim2022-12-212-0/+323
| | | | | | | | | | | | | Adds the authenticationRequired signal. [ChangeLog][QWebSocket] QWebSocket now supports 401 Unauthorized. Connect to the authenticationRequired signal to handle authentication challenges, or pass your credentials along with the URL. Fixes: QTBUG-92858 Change-Id: Ic43d1c12529dea278b2951e6f991cc1004fc3713 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWebSocket: honor subprotocols specified with setRawHeaderMårten Nordheim2022-11-241-7/+21
| | | | | | | | | | | We would error out with a ConnectionRejected if the server accepted one of the protocols specified directly in the header since we did not consider those at all. Fixes: QTBUG-108276 Pick-to: 6.4 Change-Id: Ifbb316c9d4871fd764e03c74caefa10f5b757155 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QWebSocket: check correct variable in if-statementMårten Nordheim2022-11-221-0/+71
| | | | | | | | | It's _usually_ correct, but if all protocols have been filtered out then it will be an empty string. Pick-to: 6.4 Change-Id: I3aa3221b7e36cfd253cd1152b13e57183bf4f905 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace QT_HAS_INCLUDE() wrapper macro with __has_include()Tor Arne Vestbø2022-11-221-1/+1
| | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 See qtbase change c3bd5ffdc8a3b459f18ba6e35fca93e29f3b0ab0. Change-Id: I79d15f92c4d1af3ae3cdd2c0c615dca36c761d1a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-075-326/+326
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Ic219197507870fd2b739f2e04ff138021e58d550 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix uninitialized QWebSocket::errorString()Juha Vuolle2022-10-051-0/+24
| | | | | | | | | Amends: bbd9f2f4f5e0fda85029fa320f793973ea607c2b Fixes: QTBUG-106937 Pick-to: 6.3 6.4 Change-Id: Ia805df3e3dd8ba61e53592ebfb0a8bfae9184042 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2315-15/+15
| | | | | | | Task-number: QTBUG-105718 Change-Id: I9ae1ecc59e30cadaa8aaef762c86126c58e32bf0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Replace QWebSocket::error signal with QWebSocket::errorOccurredØystein Heskestad2022-08-031-1/+1
| | | | | | | | | | The signal error(QAbstractSocket::SocketError) is deprecated because it overloads the function error() and the naming does not match other similar signals. Fixes: QTBUG-101756 Change-Id: Ifbddef73ea39b03a6c72b0e09caa2031135d7687 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2810-10/+8
| | | | | Change-Id: Ie0b008d4f8f594044049c38a3cc5ef1c05f27d1e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-0715-0/+45
| | | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I65958aab98f3b821ad8154b3d0d09504c9c7537b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1013-351/+26
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ief6ca28118c5ce0abe5dccf1854731cf2215e2b6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android: package qml test dataAssam Boudjelthia2022-05-181-0/+5
| | | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-88846 Change-Id: I7505f68e99d173edd93770b2b37c77ecc2b128e7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Android: ignore some tst_qwebsockerserver unit testsAssam Boudjelthia2022-04-211-0/+5
| | | | | | | | | | | | | | Ignore those tests to allow enalbing CI tests and fix them one by one after that. These couple cases fail mainly because they don't have the openssl libs bundled with the apk, that is expected to be handled under QTBUG-89053. Task-number: QTBUG-102713 Pick-to: 6.2 6.3 Change-Id: I5cb3d9f62f6943d1477c99456cd650b69ab8c86d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Fix handshake looping infinitely making no progressMårten Nordheim2022-04-011-0/+56
| | | | | | | | | | | | | | | | | | | The processHandshake function may make no progress and return. The loop calling processHandshake previously had no way of knowing this and would happily loop forever despite the outcome being the same every time. This was particularly noticeable with any response that doesn't include the \r\n\r\n sequence the first time we call processHandshake. Since processHandshake either fails or succeeds, not performing any partial-reads, we simply move it out of the loop and restructure some of the code around it. Pick-to: 6.3 6.3.0 Fixes: QTBUG-102111 Change-Id: I3955e4b90eb1be0a0ef5dfcf8a46921a086a8b49 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Revert "Blacklist: test cases blacklisted in tst_QWebSocketServer:"Pasi Petäjäjärvi2022-04-011-4/+0
| | | | | | | | | | This reverts commit 1d0767f546db7db839029d1f51196dc0f60390ae. Reason for revert: Cannot reproduce Task-number: QTBUG-101333 Change-Id: Ib926359f4e23f926d8694f5c63460e978c3a5237 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* tst_QWebSocket: fix scope of ifdef proxy-checkMårten Nordheim2022-03-311-2/+1
| | | | | | | | | Because other tests had made their way inside Pick-to: 6.3 6.2 Change-Id: Ie6fa545a84c2f66e0c2617f498118a3e04eedd0c Reviewed-by: Arno Rehn <a.rehn@menlosystems.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add support for WebSocket Sub-ProtocolsArno Rehn2022-03-303-1/+120
| | | | | | | | | | | | | | | | | Sub-Protocol support follows RFC 6455 Sections 4.1 and 4.2. See also https://datatracker.ietf.org/doc/html/rfc6455. This patch introduces a new class QWebSocketHandshakeOptions which collects options for the WebSocket handshake. At the moment, this contains only accessors for sub-protocols. In the future, it can be extended with things like WebSocket extensions. [ChangeLog] Add support for WebSocket Sub-Protocols Fixes: QTBUG-38742 Change-Id: Ibdcef17f717f0a76caab54f65c550865df1ec78d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-222-14/+0
| | | | | | Pick-to: 6.3 Change-Id: Icaf0fac81f51432c706a948d0986aae68e44fffb Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Blacklist: test cases blacklisted in tst_QWebSocketServer:CI Insignificant Platforms Monitor Bot2022-02-281-0/+4
| | | | | | | | | | - tst_handleConnection on qnx Pick-to: 6.2 Pick-to: 6.3 Task-number: QTBUG-101333 Change-Id: If81ec4cb7099063d9b000221aca521579979653c Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io>
* tst_QWebsocketServer: Update TLS backend check to be runtimeMårten Nordheim2022-02-021-10/+4
| | | | | | | | | | Because we use plugins now, the #ifdef compile-time checking is not reliable Pick-to: 6.3 6.2 Change-Id: I94dab4250179ae8f15fd5154c6ccb9918329be2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove unused .qrc fileJoerg Bornemann2022-01-201-6/+0
| | | | | | | Task-number: QTBUG-94446 Change-Id: I78cdaf40046bd20b37d3ec7fd85ff0e94756a229 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Re-enable cmake build test for qtwebsocketsJuha Vuolle2022-01-112-8/+36
| | | | | | | Task-number: QTBUG-92967 Pick-to: 6.2 6.3 Change-Id: I2c138fd2614c08936e4253ec58c82d282cd726f3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Reuse qtbase's HTTP header parser to avoid a reinvented wheelØystein Heskestad2021-12-094-50/+40
| | | | | | Fixes: QTBUG-80700 Change-Id: I7b713fd869ac802d5eee8ebb8d90a2115365b509 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-221-1/+1
| | | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Pick-to: 6.2 Task-number: QTBUG-95018 Change-Id: I06f634b2196b5207a4cf8f926e0886cc999fa5ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Fix documentation warningsTopi Reinio2021-09-081-0/+0
| | | | | | | | | | * Rename a file included by QDoc to have the correct extension * Add missing \a command to mark a function argument Pick-to: 6.2 Fixes: QTBUG-96287 Change-Id: I9724b67f641ba634c91a74e3e05821f1edfeb4ad Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove outdated qmake pro-filesØystein Heskestad2021-07-2015-163/+0
| | | | | | Task-number: QTBUG-95167 Change-Id: I32f5c1f9d3a1a7cfd1c7ceea6a887418789bc63a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use fixed qt_add_resource BASE argumentJoerg Bornemann2021-05-221-8/+2
| | | | | | | Task-number: QTBUG-86726 Change-Id: Ib270d786ded8cc64c2cc596b92bb4e30051de311 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate projects to use new CMake APIAlexandru Croitor2020-12-1010-12/+12
| | | | | Change-Id: Iaaa4a44c8cf8735aa17293540e701ababace8155 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove Qt5 leftoversPeter Varga2020-12-017-107/+1
| | | | | Change-Id: Ifecb6f90687601a20e719db3ba194e33f3303f24 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix the buildSona Kurazyan2020-06-291-4/+4
| | | | | | | Fix the build failing after d7ccd8cb4565c8643b158891c9de3187c1586dc9. Change-Id: Ib84138cc94a0ce04f83a20a91be48e11abb6f569 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-231-2/+2
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I36460d504aaac08bdbb64b6c71b5ab10e062e00d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Qt6: Remove single usage of soon to be deprecated QStringRefKarsten Heimrich2020-06-101-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: I03279783140af155b5db55f5c0584832af009f8a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-081-4/+4
| | | | | | Task-number: QTBUG-84469 Change-Id: I88d02a42879cefaefbbbcf9faa6b5c3a84ec4f1a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Blacklist two tests in handshakerequestLiang Qi2020-05-191-0/+5
| | | | | | Task-number: QTBUG-84315 Change-Id: I0bbe1e22adcf7e653d44921d8fc9ec603dc36283 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Stabilize testAllan Sandfeld Jensen2020-05-081-1/+1
| | | | | | | It times out on my machine. Change-Id: I6c57167c76eca434b2c64d4938e034452e4d7e02 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-312-3/+89
|\ | | | | | | Change-Id: I7b3d96575073eb6537b40286c027074969bf8076
| * Add a public api to set max frame and message size (CVE-2018-21035)Franck Dude2020-03-192-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | This change allows the user to set a lower allowed frame/message size for reception. The purpose is to avoid an attacker to exhaust the virtual memory of the peer. Fixes CVE-2018-21035 [ChangeLog] Added public API to set the maximum frame size and message size Task-number: QTBUG-70693 Change-Id: I5dc5918badc99166afdcc8d9c6106247a9f8666f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Revert "Speculatively increase timeouts in tst_qwebsocket"Timur Pocheptsov2020-03-191-5/+5
| | | | | | | | | | | | | | | | | | This reverts commit 8c4b6d212c72b8bb59bc687cbc35bbdebe112434. Reason for revert: It didn't fix the issue Change-Id: I11490a968746255e6f7fd906cddcc3ee36ca6201 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * Speculatively increase timeouts in tst_qwebsocketMårten Nordheim2020-03-181-5/+5
| | | | | | | | | | | | | | In case it's causing these recent failures. Change-Id: Icdedab57e2e46d332bf1ae9c1d4869a2ed480d94 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | CMake: Regenerate projects after mergewip/cmakeAlexandru Croitor2020-03-2310-31/+14
| | | | | | | | | | | | Change-Id: I3cdf755e3aae933016b9719ce4c61f53e554ea48 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-233-17/+6038
|\ \ | |/ | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: I1608720522e974c7107f00599a9fb70f17865189
| * Stabilize tst_QWebSocketServer::tst_handshakeTimeoutv5.15.0-beta2Mårten Nordheim2020-03-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | The test was a bit flaky which seems to have been due to the short timeout. Increase the timeout a considerable amount, it doesn't matter much to the runtime anyway: the test still takes around 5 seconds to finish. Fixes: QTBUG-82559 Change-Id: Ie14ea204de1cc7ac2951144099d5be88adebef04 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Stop forcing deprecated ssl protocol versionMårten Nordheim2020-01-171-1/+0
| | | | | | | | | | Change-Id: I422a2498bb940f801484d3f2e6e5d59edd637514 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-301-0/+6021
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ic89c6250fae297177b4990de302b4bde71709216
| | * Add binary compatibility file for qtwebsockets 5.14 branchMilla Pohjanheimo2019-12-161-0/+6021
| | | | | | | | | | | | | | | | | | | | | BC file built against 5.14.0 added. Change-Id: Ib72e1fd443bf88cec944ab451edcc43ca070a135 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Cleanup QWebSocketFrameChristian Ehrlicher2019-11-261-15/+11
| |/ | | | | | | | | | | | | | | | | | | | | Remove QWebSocketFrame assignment and move stuff by our own - the default ones are good. Also reorder the members to reduce the padding (56 to 48 bytes on 64bits). Change-Id: Ib4628628af924c36ad3cd9bf67ce72752ef97ff5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>