Commit Graph

77 Commits

Author SHA1 Message Date
Amir Masoud Abdol c2d37f9646 Retire the qt_parse_all_arguments
Task-number: QTBUG-99238
Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-20 16:40:42 +01:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Ulf Hermann 2b138dd517 Unblacklist tst_qqmlxmlhttprequest
The test hasn't failed anymore for half a year.

Fixes: QTBUG-99149
Change-Id: Ie9ebef0f92f3b9a02426184295da7c18469f5669
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-12 12:43:37 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
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: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Kimmo Ollila 0fc8a511ba INTEGRITY: Fix some test cases from core/qml folders
-Add dummy_imports.qml to TESTDATA
-Let qmlimportscanner handle plugin import
-Skip cases that depend on mounted filesystem

Task-number: QTBUG-99123
Pick-to: 6.3 6.2
Change-Id: I99e21e423f2114c4c4ee1e24bdf9bb85af51baf7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-03 08:26:06 +02:00
Assam Boudjelthia 6e6e22b07d Skip test cases execute the app's main shared lib on Android
Because on Android the project main target is compiled into a shared
library.

Pick-to: 6.2 6.3
Task-number: QTBUG-99214
Task-number: QTBUG-97056
Change-Id: Ia0b5d84f6a07964ce7e1802c42a9b35675248e51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-17 13:43:14 +02:00
Shawn Rutledge ea48b0e129 Blacklist failing tests on macOS arm
Task-number: QTBUG-81938
Task-number: QTBUG-99149
Change-Id: Ia982300a3069014f841a04f19b5358aef0cf8673
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-12-12 14:39:37 +01:00
Mårten Nordheim 06e68e0cc0 qqmlxmlhttprequest: Fix h2c fallout and ignore in future
The headers were hardcoded but seeing as they are ultimately ignored
on the server-side (which is following the spec) we can also ignore them
if they come back in some form in the future.

Pick-to: 6.2
Fixes: QTBUG-98811
Change-Id: Ida490cbd8193eb3e3bf8d56fd387af93c408d921
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-02 12:52:57 +01:00
Fabian Kosmale 04f635b808 tst_qqmlxmlhttprequest: Skip locale dependent tests
...in case the locales is not en-us. Ideally we would make the test not
dependent on the system locale, but the best way to achieve is not
clear, and skipping tests that have no chance of succeeding is the next
best thing we can do.

Pick-to: 6.2
Fixes: QTBUG-59223
Change-Id: I1d7dfca267b01b701e369043d028d61f2f687fcd
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-11-26 15:57:02 +01:00
Mitch Curtis e310dadef7 Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared
folder. Now we make those sources a library, build it once, then have
each test link to it instead.

We also take the opportunity to move some helpers that qtquickcontrols2
had added into the quicktestutils library where it makes sense, and
for the helpers that don't make sense to be there, move them into
quickcontrolstestutils.

We add the libraries to src/ so that they are internal modules built as
part of Qt, rather than tests. That way we can use them in a standalone
test outside of qtdeclarative.

Task-number: QTBUG-95621
Pick-to: 6.2
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-13 21:17:04 +02:00
Andreas Buhr 7e029878c0 Fix some "can be marked override" warnings
Change-Id: I13da0d085901314950c4fa0afb5853e183652e67
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-02-23 16:50:07 +01:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Giuseppe D'Angelo d6091eb768 XHR: allow the user to set the User-Agent header
The Fetch spec has allowed it for a while (in other words,
it's no longer forbidden):

* https://fetch.spec.whatwg.org/#terminology-headers
* https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name

Cf. also

* https://github.com/whatwg/fetch/issues/37
* dab09b0c48

[ChangeLog][QtQml][XmlHttpRequest] It is now possible to set the
User-Agent header.

Change-Id: I1d5bd785223e9df2883011f873d440a63e363a24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-06 06:32:23 +02:00
Lars Knoll 6412bcd221 Fix xmlhttprequest autotest after HTTP/2 changes in qtbase
Change-Id: I32029f4f70da909b0b0d088899ac0c3138454792
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-15 13:32:47 +02:00
Ulf Hermann ab7e52377e tst_qqmlxmlhttprequest: Ignore HTTP encoding headers
Apparently QtNetwork changed the default order of encodings. We don't
really care about this anyway, though.

Change-Id: I72e5f0783e5e88ddb9fe031f72ff5f6c760256fa
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-12 12:42:01 +02:00
Tor Arne Vestbø a5df29201f CMake: Update Apple platform defines after rename in qtbase
Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-17 10:42:00 +01:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Alexandru Croitor 1d4fa26a70 Regenerate qtdeclarative
Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-02-12 17:30:34 +00:00
Maximilian Goldstein 899de66d41 qqmlxmlhttprequest: Disable local file access by default
[ChangeLog][Important Behavior Changes] Local file accesses are now
disabled by default for security reasons. To enable them set the
environment variables QML_XHR_ALLOW_FILE_READ / QML_XHR_ALLOW_FILE_WRITE
to 1 for reading and writing respectively.

Change-Id: Idf225d6eb8f16b1716867101b8e768926242b7bf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-12 12:48:56 +01:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Maximilian Goldstein a07251df7c qqmlxmlhttprequest: Add ability to disable file:// requests
Introduces two new flags:

QML_XHR_ALLOW_FILE_READ: Controls whether GET can be used with file://.
QML_XHR_ALLOW_FILE_WRITE: Controls whether PUT can be used with file://.

In Qt 6 these will be off by default. At the moment having these unset
while using either GET or PUT on file:// will just result in a warning.

Change-Id: I2d85e88f1ddba8153ccbbd833ec7de5c1d0d8b5b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-15 10:17:59 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor 387f360b3b Regenerate tests
Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:34 +00:00
Leander Beernaert 4e14f6e70a Add QtDeclarative Test Coverage
All tests compile and run on a developer build.

These tests are failing:
tst_qqmlsqldatabase Fails due to missing sql driver
tst_qqmlsqldatabase Fails in wip/qt6
tst_ququicklayouts Fails in wip/qt6
tst_flickableinterop Fails in wip/qt6
tst_qquickpinchandler Fails in wip/qt6
tst_qquickflickable Fails in wip/qt6
tst_qquickgridview Fails in wip/qt6
tst_qquickimage Fails due to missing jpeg plugin
tst_qquicklistview Fails in wip/qt6
tst_qquicktext Fails in wip/qt6
tst_qquickcanvasitem Fails in wip/qt6
tst_scenegraph Fails due to missing jpeg plugin
tst_TestFiltering Fails in wip/qt6

Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-14 14:01:58 +00:00
Simon Hausmann 1c2242e610 Add support for onload/onloadend/onerror callbacks in XHR
Those functions are supposed to be called after readystatechanged, with
onloadend coming last.

Task-number: QTBUG-67337
Change-Id: I946cd3c7edbe762c1b66345ec8649562d2246d34
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2018-07-18 16:30:36 +00:00
Simon Hausmann 51b73e0bb6 Fix XMLHttpRequest when used with QQmlEngine::evaluate
Our XHR implementation insists on a valid QQmlContext when processing
callbacks. This is to protect against callbacks being triggered after
dynamic QML contexts such as delegates have been destroyed.
Unfortunately those checks are too strict and make it impossible to use
XHR from within plain JS scripts (where v4->callingQmlContext() will
return a null pointer).

Dispatching the callbacks in functions that are directly called from
QML/JS is safe and something we can do unconditionally. This applies to
the callbacks triggered from abort() and open() for example.

When we're called from QNetworkAccessManager we should enforce the
continued existence of a QML context only if it was present at send()
time.

Task-number: QTBUG-67337
Change-Id: I8235f6ef407adc3eaeeff4eee72238ba6750afb2
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Valery Kotov <vkotov@luxoft.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-09 13:42:24 +00:00
Kevin Funk 9880acb424 Replace remaining Q_NULLPTR with nullptr
Change-Id: I28a32af7f1c306a3002d47025a842475f848c1a4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-17 10:05:23 +00:00
Ulf Hermann 0c999c2e52 Tests: Clean up inclusion of util.pri and debugutil.pri
When we include debugutil.pri, we always want util.pri, too. We can as
well nest the inclusions.

Also, setting the include path is much easier from within the .pri files
than from outside.

Change-Id: I1205bdc3051e16e635d4ea9626f44e51002ddb50
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-17 07:53:04 +00:00
Alberto Mardegan 5c80b29e6d QQmlXMLHttpRequest: support sending ArrayBuffer data
The XMLHttpRequest.send() method should be able to send arbitrary binary
data, and not just UTF-8 text: with this change we first attempt to use
the parameter to the send() method as an ArrayBuffer, and fall back to a
QString if that fails.

[ChangeLog][QtQml] Allow sending binary data, encoded as ArrayBuffer
objects, via XMLHttpRequest's send() method.

Task-number: QTBUG-61599
Change-Id: I25781969ee39b4d168e5c76315ed9853092b322b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-26 14:10:54 +00:00
Jani Heikkinen 7a1c8715cb Fix licensing
- Remove unused license files
- Switch old LGPLv21 license headers with GPL-EXCEPT one

Task-number: QTBUG-57147
Change-Id: Ib59c3e2e39bfe0038db795af85dc75028564efa3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-04 04:30:21 +00:00
Valery Kotov a8399c5440 QML Engine: Support for "PATCH" method for XMLHTTPRequest
Support for HTTP PATCH method was added to QQmlXMLHttpRequest. Tests for
PATCH method in XMLHttpRequest were added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports the PATCH method in HTTP requests.

Task-number: QTBUG-38175
Change-Id: Ib3c104b558f626bb63624e234f1362adcf6cbd4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-03 13:23:55 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Liang Qi 7063fefe4b Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
2015-10-14 15:48:12 +02:00
Friedemann Kleint 0f5a721761 Tests: Fix single-character string literals.
Use character literals where applicable.

Change-Id: Ib0e618752fbc762a73a0a91c43efab61ef2c9687
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-13 14:24:16 +00:00
Liang Qi 68607aeeeb Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
2015-09-06 10:39:51 +02:00
Friedemann Kleint 7ea2bb8764 Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.
Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-09-03 19:23:46 +00:00
Julien Brianceau 1faca908dd XHR: Server side errors are not network errors
XMLHttpRequest specs state that only 'network errors' should result
in a request error, and a server side error like HTTP 500 Internal
Server Error (which results in QNetworkReply::InternalServerError)
is an indication of the HTTP server response rather than a network
error.

Change-Id: I94bf678a8487e3d31007dc5119d6fb4e87ea3102
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
2015-08-27 14:08:00 +00:00
Friedemann Kleint 0ea3c24cfe tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-29 09:44:39 +00:00
Friedemann Kleint 0959281be2 Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.

Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 12:32:49 +00:00
Valery Kotov f21df860fc QML Engine: Support for "PROPFIND" method for XMLHTTPRequest
Support for WevDAV PROPFIND method was added to QQmlXMLHttpRequest. Tests for
PROPFIND method in XMLHttpRequest were added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports the PROPFIND method in HTTP requests.

Task-number: QTBUG-36456
Change-Id: Ie36fcc901e7c1583840f04166c1774a1defe9308
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-18 16:36:26 +00:00
Simon Hausmann 9556f6d075 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/qml/jsruntime/qv4engine_p.h
	src/quick/items/qquickitemsmodule.cpp
	src/quick/items/qquicktext.cpp
	src/quick/util/qquickpixmapcache.cpp
	tests/auto/quick/qquickwindow/tst_qquickwindow.cpp

Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
2015-06-04 10:28:48 +02:00
Valery Kotov c331b6b90f QMLEngine: Update XHR tests with checking status code
Update QQmlXMLHttpRequest unit tests with checking status code in
resopnse message.

Task-number: QTBUG-45581
Change-Id: Ia9fdb4463582bdb098be5d0cab022993904a3d51
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-05 09:24:23 +00:00
Simon Hausmann 6c1d99c249 Fix default value for XMLHttpRequest.response property
The default value for responseType is the empty string, for which
the expected data type for the response property is a string - same
as when the response type is set to "text". In other words: By default
the response property should contain the string representation of the
data.

Task-number: QTBUG-45862
Change-Id: I563160e5cdfbf93aca7e283e455d77a6b9deceb4
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-05-03 16:33:26 +00:00
Simon Hausmann 94db5de2ac Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	tests/auto/quick/qquicktext/tst_qquicktext.cpp

Change-Id: I075e742da8396a268d97d3ab34bcd9e0c0cf001f
2015-04-28 14:29:59 +02:00
Simon Hausmann e2447f9f5f Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp

Change-Id: I715b8a78b74cbe0dcaf599367fd6e08af4858e11
2015-04-27 14:40:00 +02:00
Simon Hausmann 79d56651ed Prospective fix for flakey "network" related QML tests
Replace hard-coded server ports with dynamically allocated ports.

Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-04-25 12:02:55 +00:00
Valery Kotov 43961057a9 QML Engine: JSON XHR response type support
Support for "json" response type for QQmlXMLHttpRequest was
added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports "json" binary response type.

Change-Id: I21b7659c02dfdc6b64a73e1d2003e269d90b3b23
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-16 17:44:29 +00:00