aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-161-0/+53
|\ | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickloader.cpp tests/auto/quick/qquickanimations/tst_qquickanimations.cpp Change-Id: I0cb9f637d24ccd0ecfb50c455cc210119f744b02
| * Don't leak components in QQuickLoaderColin Ogilvie2018-07-051-0/+53
| | | | | | | | | | | | | | | | | | | | | | Only create source component in loadFromSource if it does not already exist. Previously toggling the active status when loading from source would create a new source component every time active became true. [ChangeLog][QtQuick][Loader] Don't leak components when changing source url. Change-Id: I1e4cfd5613e3851fcb4f3f55e78981f7c070cc77 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Adjust expected error message to new parserLars Knoll2018-05-021-2/+2
|/ | | | | | | | The new QML/JS parser does sometimes give slightly different error messages. Change-Id: I7fbec77214df2830d5965d8959874b51a410694a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* When deactivating a loader, do not immediately clear its contextErik Verbruggen2018-03-162-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2eb2d6386da304cd1164264ae0bff685c796d89c, deactivating/clearing the loader would now prevent any subsequent bindings from being evaluated. The problem there was that the item created by the loader wouldn't have a parent item (among things) anymore, so references to it in the bindings would result in errors. The way to prevent it was done by invalidating the context of the item, which in turn would detach it from the root context. This is a problem if objects in the root context are referenced after deactivating/clearing the loader: onSomethingChanged: { loader.source = "" objectInRootContext.doIt() } This would result in a ReferenceError when resolving objectInRootContext and break the behavior present before the fix mentioned above. The correct way is to recursively clear the context set on all bindings, but leave everything in place. This way, no subsequent bindings will be evaluated, but the currently "running" scripts will still be able to reach the root context. Task-number: QTBUG-66822 Change-Id: Ic9c2ab0a752093a26967da4783cb4c29cf83d2ca Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-2/+2
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-34/+34
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tests: Wrap qWaitForWindow{Active,Exposed} in QVERIFYv5.11.0-beta1Kari Oikarinen2018-02-231-2/+2
| | | | | | | | | | | The functions are marked Q_REQUIRED_RESULT, so they give compilation warnings when not handling the bool return value. Failing the test early at an unexpected event is also better behavior anyway. Task-number: QTBUG-66559 Change-Id: I6c4db29379ec01528208c3e4ee54346b4230616c Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-123-0/+135
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/shapes/qquickshape.cpp src/imports/shapes/qquickshape_p_p.h src/qml/compiler/qqmlpropertycachecreator_p.h src/qml/jsruntime/qv4value_p.h src/quick/items/qquickloader_p.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tools/qmlprofiler/qmlprofilerapplication.cpp Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-02-023-0/+135
| |\ | | | | | | | | | Change-Id: I41ca9120a470a905c2f5c168c1de4cf970fa0fff
| | * If Loader loads Window, set its transient parent to the Loader's windowShawn Rutledge2018-02-023-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the Item { Loader { sourceComponent: Window { } } } case consistent with the Item { Window { } } case: the inner Window is transient for the outer Window. It works even if the Loader's Window has a visible: true declaration: in that case, until now, the Loader's Window would become visible at component creation time, before the outer Item became visible. So the test to check whether it had a transient parent did not work. We now change the delayed-visibility mechanism in QQuickWindowQmlImpl to wait for the parent Item to acquire a window of its own rather than waiting for the transient-parent-if-any to become visible. It should still take care of all the old cases too, e.g. in the Window { Window { } } case, the inner Window's QObject parent is actually the QQuickRootItem. (Amends 701255c76f671f100338a799f0194bf10e26c9d1) [ChangeLog][QtQuick][QQuickWindow] When a Window is declared inside another Item or Window, the window will not be created until the parent window is created. This allows it to have the correct transientParent and be managed as a transient window. Task-number: QTBUG-52944 Change-Id: Iaf4aafbd696f6e8dd0eec1d02db8bd181483bd07 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-093-158/+290
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/memory/qv4mm.cpp src/qml/qml/qqmlbinding.cpp Change-Id: I98e51ef5af12691196da5772a07d3d53d213efcc
| * | Prevent errors when unloading LoaderMichael Brasser2018-01-053-0/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invalidate the context of the object so that destruction is signaled and bindings no longer run. Task-number: QTBUG-47321 Task-number: QTBUG-51995 Task-number: QTBUG-60344 Change-Id: I194a2fefe4e769a58c9ce022d39fe76cbe230de7 Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | tst_qquickloader: use QScopedPointer instead of manual deletionMitch Curtis2018-01-021-149/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps keep the memory usage down on test machines in case of failed tests, and may also prevent a failed test from interfering with the results of subsequent tests. Change-Id: I4284b068f94ce990e6a0c5a2f12185739dfdf5d7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | tst_qquickloader: use local engines instead of one global engineMitch Curtis2018-01-021-11/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reusing the same engine was causing new tests that I was going to add to pass unexpectedly. By using one engine per test, we also make warnings like QWARN : tst_QQuickLoader::loadedSignal() "There are still \"1\" items in the process of being created at engine destruction." show up at the end of the test that caused them, rather than after the entire testcase has finished, which should make fixing the warnings easier. Change-Id: I821d4feb74e7e837177c9463c65936f90b3b20d8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-062-4/+12
|\| | | | | | | | | | | Change-Id: I1ed923d72566af663555898c3ec708191eef8ae9
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-242-4/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmltypenamecache.cpp Done-with: Ulf Hermann<ulf.hermann@qt.io> Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
| | * QQuickLoader: Use setSize() to resize itemAlexandr Akulich2017-10-202-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sequential call of setWidth() and setHeight() results in outdated height on widthChanged() signal. Use setSize() to set width and height at once. Change-Id: I86ff5cef2da912a8855c66a614d5d7d2e71f1de8 Reviewed-by: Risto Avila <risto.avila@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Enable tests for boot2qtSami Nurmenniemi2017-09-211-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests needed fixing - Disabled tests too heavy for qemu - Skipped tests requiring OpenGL without support from the platform - Skipped tests requiring functionality on broken offscreen platform - Skipped tests that take too long on qemu + software renderer - Blacklisted tests for created bugs QTBUG-63049, QTBUG-63053 QTBUG-63055 and QTBUG-63057 Task-number: QTBUG-60268 Change-Id: I0346b0e436cf286d7d9cbc140acf324a4087cfb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / Tests: Clean up inclusion of util.pri and debugutil.priUlf Hermann2017-08-171-1/+0
|/ | | | | | | | | | | 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>
* Do not leak the item, and use a QScopedPointer to guarantee cleanupJan Arve Saether2017-01-231-2/+1
| | | | | Change-Id: Ib4160f418686cef6d85dfd64657d25836f66778e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix import with qualifier of remote directory with qmldirArnaud Vrac2016-08-101-1/+0
| | | | | | | | | | Do not skip qmldir loading when using an import qualifier and the resolved uri is remote. This makes the import behavior the same in all cases. Task-number: QTBUG-55002 Change-Id: I99d68be02ddd062e387d36946e730df076e80a8d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Clean up file/error handling in the type loaderSimon Hausmann2016-06-201-3/+3
| | | | | | | | | | | Fold the functionality of reading QFile contents via QQmlFile into QQmlDataBlob::Data. This reduces the dependency on QQmlFile - which is scheduled for removal - and it makes it possible in the future to avoid reading the file altogether if we have a cached compilation unit on disk. Change-Id: Ieeaf52b6fb1d25665cd3c3b196819e25aba3dd15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-14/+7
|\ | | | | | | Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
| * Provide a threaded TestHTTPServerUlf Hermann2015-10-141-14/+7
| | | | | | | | | | | | | | | | | | This allows us to do blocking operations that interact with the test server in the main thread. The threaded server is used in tests that don't explicitly require asynchronous operation. Change-Id: Ibcb28e79a1114cb9cfb812e86aae0a1af71c569e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Allow forced completion of asynchronous Loader.Michael Brasser2015-09-101-0/+69
| | | | | | | | | | | | | | | | | | | | | | Setting Loader::asynchronous from true to false will attempt to force complete any operations in progress. This allows the user to begin loading something in the background, and then force the load to complete once the Loader's content must be viewed. Change-Id: I056dcc20faacb38b3529c967245416da9949e64a Task-number: QTBUG-29789 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
|/ | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-271-15/+15
| | | | | | | | | | | | - 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: Ib9f4c2486af23c47990be4b9e004b965de226dcc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Simon Hausmann2015-04-272-19/+26
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp Change-Id: I715b8a78b74cbe0dcaf599367fd6e08af4858e11
| * Prospective fix for flakey "network" related QML testsv5.4.2Simon Hausmann2015-04-252-19/+26
| | | | | | | | | | | | | | Replace hard-coded server ports with dynamically allocated ports. Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Tests: Make qquickloader tests significant againCaroline Chao2015-04-071-1/+0
| | | | | | | | | | | | | | | | The qquikcloader tests are passing in CI. Change-Id: I472e20cdeb76f867b9cb02e3bcfdc447825d4d14 Task-number: QTBUG-30721 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Update copyright headersJani Heikkinen2015-02-121-7/+7
|/ | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* TestHTTPServer: Make listening an explicit operation that reports failure.Robin Burchell2014-03-211-8/+8
| | | | | | | | | | Use this to print the error message when listening fails, and switch to always stack allocating TestHTTPServer instances for easier cleanup. Change-Id: I63b2bd38963b66611dc08a5c322615d91a91e675 Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Add a column to the default method error messageSimon Hausmann2014-03-021-1/+1
| | | | | | | | This brings both compilers in sync by reporting line and column if doing a signal object assignment without a default method. Change-Id: I8b1bf90c4ce3cd7b117ad7eecdbfe319b07b1191 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash in QQuickLoader when source component is garbage collectedSimon Hausmann2013-12-063-0/+32
| | | | | | | | | | It may happen that the QQuickLoader is the last entity left in the system holding a reference to the QQmlComponent *sourceComponent. We have to let the garbage collector know about that by keeping a persistent value for it. Task-number: QTBUG-35334 Change-Id: I715864440378fd9dd4f2d5ef8ff2f171c81ed7ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Mark tests tst_qquickloader as insignificant due to random failuresTony Sarajarvi2013-07-021-0/+1
| | | | | | | | Task-number: QTBUG-30721 Change-Id: I540848b1e7c9992e89b6df2417c37ce5e81423c8 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QQuickLoader: fix the recursion guard for size updatesJ-P Nurmi2013-03-172-0/+29
| | | | | | | | Task-number: QTBUG-30183 Change-Id: Ic8720e1e35bf2f349d74d2021dd202849da67852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Improve timer dependent tests.Frederik Gladhorn2013-03-112-5013/+29
| | | | | | | | | | | | | | | | | | tst_QQuickLoader::loadedSignal depended on sharing the engine with simultaneousSyncAsync and that function being run before it. After each test run call clearComponentCache() as that is important for caching of the network tests. The test server would send the item after 500ms. Sometimes the CI would be faster or slower. Instead of relying on timing, simply call a function when the reply should be sent. Change-Id: Ifb0447041197e1cba103570597a62a2510d31aab Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Stabilize QQuickLoader test on Windows.Friedemann Kleint2012-12-191-0/+2
| | | | | | | | | Wait until the component is ready in network tests. Task-number: QTBUG-28611 Change-Id: I3f880ee585199a3c8ba2d672bb365fa60c472499 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Stabilize tst_qquickloader test caseMatthew Vogt2012-07-301-14/+22
| | | | | | | | Ensure cases are not affected by timer events of incubation controllers created in previous cases. Change-Id: Ia633ed142242d000de5f497896a685ca2f26e143 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Stabilize Loader test.Michael Brasser2012-07-101-2/+4
| | | | | | | | Wait for Loader to load its item, rather than using a fixed timeout value. Change-Id: I97ee56d0d7161c9c71a5524f108b0f56d92cc3f3 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Use unique port numbers for http servers in auto tests.Andrew den Exter2012-07-052-6/+7
| | | | | | | Prevents conflicts when tests are run in parallel. Change-Id: Ic1652d963da291c7c41b31e2621874824fa575cb Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
* Decode directory separators in source URLsMatthew Vogt2012-06-252-0/+9
| | | | | | | | | URLs with encoded directory-separator characters are not correctly processed by QUrl. Task-number: QTBUG-25981 Change-Id: I78173ef44c4850774b56753335bea34db04c0735 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Emit itemChanged when Loader fails to load a source.Alan Alpert2012-06-121-1/+1
| | | | | | | | | | | | As per the source comment, it is not actually tracked whether item was null before. This is consistent with the behaviour in loadFromSource, where setting a source to null always emits item changed. This is reasonable behaviour, because it only occurs in unexpected error states where the program logic likely expects a changed signal anyways. Change-Id: I160ab04dc1b5c578ee508f4adbca65e8da5b16be Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Allow Loader to load non-Item types.Martin Jones2012-06-121-3/+8
| | | | | | | | | Loader has a more convenient API for loading/unloading components than the dynamic object creation APIs. Remove the Item-only restriction. Change-Id: I6f9ecc8514ff1e814f7e56a3386814ba211b7e4f Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Removed CONFIG+=parallel_test from parallel-unsafe testsRohan McGovern2012-05-141-2/+0
| | | | | | | | These tests are marked with CONFIG+=parallel_test, but are observed to fail sometimes if run concurrently with other tests, and pass otherwise. Change-Id: Id59209ca80c7449bdc0689af522c82ff00c4b588 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>