aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Move QtQuick.Shapes implementation to qtquickshapes, privately exportedPaolo Angelelli2018-06-212-24/+2
| | | | | | | | | | | This change moves the implementation of QtQuick.Shapes into an own qt module, where classes are privately exported. In this way Shapes QML types can be internally (= from other Qt modules) instantiated also from cpp. Change-Id: I428f981f0a1f3083e6571cbeaffa706fd8ef7254 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Always generate QML cache files in the cache directory, never in sourcesRichard Weickelt2018-06-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This patch eliminates the annoying behavior of the QML compiler that .qmlc cache files are stored alongside the sources. When cache files are generated at run-time, then they are always stored in the application's local cache directory defined by QStandardPaths::CacheLocation (qmlcache subfolder). The application's uninstaller is responsible for cleaning up the cache directory during removal. If explicitly precompiled QML files exist at the source location, then they are loaded from there and no cache file is being generated. Storing cache files in the source directory is as problematic as an in-tree build. The cache files pollute the source directory and create unnecessary inconvenience with version control systems. [ChangeLog][QtQml][QQmlEngine] QML cache files are now always stored in the application's cache directory when being generated at run-time. If precompiled QML files exist at the source location, then they are loaded and no cache file is being generated. The application's uninstaller is responsible for cleaning up the cache during removal. Task-number: QTBUG-56150 Change-Id: I5a64b7f958e782e03c71873a82cef4b07011cbf1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rework unwind handlingLars Knoll2018-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The old code was rather convoluted and expanded to quite a bit of bytecode. It was also very hard to fix some of the remaining issues with unwinding in there. The new code handles unwinding a bit differently. Basically, we now have three instructions to do what the spec requires. SetUnwindHandler is the same as the old SetExceptionHandler instruction. It basically tells the runtime where to jump to to handle any abrupt completion (ie. throw/break/continue/return) that requires unwinding. UnwindToLabel is a new instruction that is used for unwinding break/continue/return statements. It takes two arguments, one telling the runtime how many levels to unwind and the second a target label to jump to when unwinding is done. UnwindDispatch is the third instruction and is invoked at the end of each unwind block to dispatch the the parent unwind handler if required and thus implement the support for the levelled unwinding. Change-Id: I079a39d0d897b3ecc2f0dc631ca29b25eae05250 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qquickpositioners::createView: replace qDebugs, fix warningShawn Rutledge2018-06-201-5/+11
| | | | | | | | | | | | | We use qCDebug(lcTests) to avoid the output clutter unless the test fails, then the CI system will re-run it with all logging categories enabled. The "1-2-3-4" count was anyway not very informative. As usual there was a -Wunused-result warning about ignoring the return from qWaitForExposed, so now we don't ignore it. (Not sure if it ought to be fatal though.) Change-Id: I48f43083cbbcf27c81f0ac951b03d7b8b76e5300 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* macOS: tst_qquickpositioners::test_mirroring: use basic render loopShawn Rutledge2018-06-201-0/+4
| | | | | | | | | We seem to be hitting a deadlock some of the time with this test, probably because it uses two windows. Task-number: QTBUG-69040 Change-Id: I2e6fd430b22a9e174973661f27c2ac29ec635f60 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devSimon Hausmann2018-06-198-2/+58010
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/qml/compiler/qv4codegen.cpp tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp Change-Id: I010505326d76ee728ffe5fbd4c7879f28adadb12
| * QQmlDebugProcess: Wait forever for debug messagesUlf Hermann2018-06-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | If we don't get the expected message in 15s, output a warning and try again. This will eventually be terminated by the overall test watchdog, but experiments show that starting processes on the CI can take minutes, so it's not worth it to have a separate timeout here. We still output the warning, so that we see in the log when this happens. Task-number: QTBUG-68741 Change-Id: I1ca9d0726753d566d8d89dd682d7d503fcd3a337 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add binary compatibility files for Qt 5.11Milla Pohjanheimo2018-06-054-0/+57946
| | | | | | | | | | | | | | Add files for binary compatibility test for QtDeclarative Change-Id: Ie7a156e40176cc98ce31d5e4189d1e41c7c6df62 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * V4: Set argumentsCanEscape when debuggingUlf Hermann2018-05-301-0/+22
| | | | | | | | | | | | | | | | | | This causes the updated arguments to be reported to the debugger when they are overwritten in the function body. Task-number: QTBUG-68534 Change-Id: I30c22d31aa97da0d58a4bbaaa032180a919669a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Formals come after locals in the CallContextLars Knoll2018-05-291-0/+32
| | | | | | | | | | | | | | | | | | | | | | The method updating the internal class for a CallContext messed up the order between locals and formals, leading to wrong name lookups for signal handlers taking implicit arguments Task-number: QTBUG-68522 Change-Id: I36d55b3b0cfe9af6397455782551498b7ddb940a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix a crash in the modulus operationLars Knoll2018-05-281-0/+10
| | | | | | | | | | | | | | | | | | | | INT_MIN % -1 crashes in C++ with an arithmetic exception, so avoid passing negative numbers into the integer operation, use fmod() instead. Task-number: QTBUG-68513 Change-Id: Ib5a37b55a0f9d41a84c7e6c00ea3f87622155de5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Ensure we read context properties before the global objectLars Knoll2018-06-174-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also global variables declared in a .pragma library script should not be saved in the global object, as the script has it's on context where those variables live. [ChangeLog][QtQml] Properties of the JS global object will now be looked up after local properties in the QML object. This can lead to runtime incompatibilities if your qml file is named the same as a property of the global object (e.g. Date.qml). Task-number: QTBUG-51581 Change-Id: I108aea4c76d088ca8c2124700f91e8eac3fc19f3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QQmlDelegateModelItem: move row and column up to the base classRichard Moe Gustavsen2018-06-092-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 8c33c70 injected row and column (alongside index) into the QML context of a delegate when the view had a QAbstractItemModel as model. Rather than only inject those properties when using QAIM, this patch will move the code to the base class. This way, if a view uses e.g a javascript list as model, row and column is still be available. This is useful, since then the delegate can bind to both row and column regardless of what kind of model the view uses. In the case of a list model, the column property will always be 0. Change-Id: I1d9f11c0b7d7a5beb83198184ba12cc1e48cd100 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | TableView: fix copy/paste failureRichard Moe Gustavsen2018-06-091-9/+13
| | | | | | | | | | | | | | | | | | This patch fixes a small typo originated from an earlier copy/paste. QQuickTableViewPrivate::rowHeight() should use cellHeight, not cellWidth. Change-Id: I85cb3730dfd0daf0a9bb16dbb0771c31a453fa13 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Ensure identical behavior for singleton types defined in C++ and QMLRichard Weickelt2018-06-083-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Singleton types defined in C++ have no QML context. Therefore, both qmlContext(obj) and qmlEngine(obj) return zero. Although documented, this behavior is surprising and inconsistent with singleton types defined in QML. The current behavior was decided upon in QTBUG-23116. This patch puts C++ singleton types into a sub-context of the root context by default, just like it is the case for QML-defined singleton types. This doesn't cause any harm, but avoids surprises. It also fixes a bug in QmlTypeWrapper that returned an invalid QVariant for QJSValue singletons. Task-number: QTBUG-38583 Change-Id: Id1d48ecdc49f0e22714857a1b49b457885889e5e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | TableView: fall back to use implicit size for delegate itemsRichard Moe Gustavsen2018-06-042-0/+89
| | | | | | | | | | | | | | | | | | | | Rather than forcing users to set TableView.cellWidth/cellHeight (and therefore also force them to create an attached object for every cell), we now also accept setting implict size as a fall back. Change-Id: I4c4c4d23fe7fc193581728d3878cf2c7e40c0745 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Show property name in error messageRainer Keller2018-06-041-1/+1
| | | | | | | | | | Change-Id: Ic78a38200959e39375753624af13c6edebe4e1f1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | skip Symbol properties in for-in loopsLars Knoll2018-06-041-2/+0
| | | | | | | | | | Change-Id: Id161269329d3cd34357580730999e4dee5b0135f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix creation of object literalsLars Knoll2018-06-041-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our method to create object literals wasn't compliant with the ES7 spec, as we would in some cases re-order the properties. This violated the spec which required properties to be created in order, so that for-of would also iterate over them in creation order. As a nice side effect, this simplifies the code and gets a couple of test cases using computed property names to pass. Task-number: QTBUG-62512 Change-Id: I6dfe004357c5d46a0890027f4fd9e2d1e1a2a17a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Implement ToPropertyKey() from the ES7 specLars Knoll2018-06-041-6/+0
| | | | | | | | | | | | | | and use it where required. Change-Id: I309ca61e0360b26428fc2ea5a2eea47c8e0632a0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix remaining test failures with the ** operatorLars Knoll2018-06-041-2/+0
| | | | | | | | | | Change-Id: I98da5b552747d6d0b363d83ecb4c408c66a2667b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | The length property of RegExp should be configurableLars Knoll2018-06-041-1/+0
| | | | | | | | | | Change-Id: Ie19dc556d13081a1b750695e81d6b4e5a6b3afac Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | TypedArray.prototype[Symbol.iterator] and .values are the same functionLars Knoll2018-06-041-1/+0
| | | | | | | | | | | | | | | | Those two properties are supposed to point to the same function object according to ES7 spec. Change-Id: Ic0917aa28836ad8d665d2177f2f5c2a8d8ad3f6d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix Object::defineAccessorPropertyLars Knoll2018-06-041-22/+0
| | | | | | | | | | | | | | | | Create setter and getter functions with proper names and make the property configurable to be compliant with the ES7 spec. Change-Id: I13b24f540fdd3261cf29b660aa3393d661acacfd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Use Symbol.toStringTag in Object.prototype.toStringLars Knoll2018-06-041-11/+0
| | | | | | | | | | | | | | | | | | This should make toString comply fully with the JS Spec. Also add a couple of missing Symbol.toStringTag properties. Change-Id: I29e2018b486a0e1d174b58ce7a14f0e42cc78767 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add the start of a Map from ES7Robin Burchell2018-06-012-135/+1
| | | | | | | | | | | | | | | | | | | | Like Set, for the time being, this is baseed on top of ArrayObject: two of them, one for keys, one for values. Again, this goes against the spirit of the spec (which requires nonlinear access), but having the API present is at least a start, and the implementation is easily changed. Change-Id: Idcf0ad8d92eb5daac734d52e8e2dd4c8e0dd5109 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add the start of a Set from ES7Robin Burchell2018-05-302-183/+1
| | | | | | | | | | | | | | | | | | | | Based on top of an ArrayObject for now, which is admittedly a bit of a cheat and not matching the "spirit" of the spec. OTOH, that makes it easy to write, and is presumably quite lightweight, so perhaps this is acceptable as a starting point. Change-Id: Ibc98137965b3e75635b960a2f88c251d45e6e837 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | qv4arrayobject: Implement Array.from from ES7Robin Burchell2018-05-301-37/+0
| | | | | | | | | | | | | | | | The remaining failures look to be down to the constructor hack, but this gets us a good part of the way there already. Change-Id: I6e57828a56edddd5cb70560b6f50dfc6311c88ae Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | qv4arrayobject: Implement Array.prototype.copyWithin as per ES7Robin Burchell2018-05-301-25/+0
| | | | | | | | | | | | | | The remaining two failures are due to Proxy being missing. Change-Id: I6cc5177cd958d98600cc2ba3b1e1a18bc420530c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fail early if process crashes in QQmlProfilerService testUlf Hermann2018-05-301-0/+2
| | | | | | | | | | | | | | | | There is no point in waiting for a different exit status if we already know that the process has crashed. Change-Id: I9a5129bb4310a851d3852291374ea2de23ef04b1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix language change support for qsTr in ListElementSimon Hausmann2018-05-282-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We must store translations by binding reference in order to support translation changes. This is similar to commit db15c3455971f47b86078a44a30e0f0a13b54204. [ChangeLog][QtQml] Fix QQmlEngine::retranslate() with ListElement objects that use translation functions such as qsTr. Task-number: QTBUG-68350 Change-Id: Ie5b4d5beb0505a260b524da820c0ce1142893d54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | The first branch in a ( ? : ) operator can always include the in keywordLars Knoll2018-05-281-1/+0
| | | | | | | | | | | | | | Fix the grammar to be compliant with the spec in this case. Change-Id: I5740c9427db6f5c6c2551d4e23f1f14070e497fb Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Implement toPrimitive() the way the ES7 spec wants itLars Knoll2018-05-281-33/+0
| | | | | | | | | | | | | | | | Add Dat.prototype[Symbol.toPrimitive] and make use of those methods in the toPrimitive implementation. Change-Id: I82a9a94dcae6822100de364373b3f4de1e3d749b Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | TableView: switch to use TableView.cellWidth/cellHeightRichard Moe Gustavsen2018-05-285-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is logically more correct since TableView will override width / height anyway to make the delegates fit into the table if they are not as wide/tall as the widest column/row. And it gets even more problematic when we recycle delegates, since in that case we need to keep the original width binding of the delegate to calulate the size of new columns. And this all fits better by using attached properties instead. Change-Id: Ia5f2acd2bfc45f3fb160c3782191ad8da9f780e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | qv4arrayobject: Implement Array.of from ES7Robin Burchell2018-05-271-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One small difficulty: We can't accurately tell whether a thisObject is a constructor or not, so right now we're just swallowing all exceptions and creating an array if they occur. This isn't correct, but it isn't trivial to fix, either: I think we would have to somehow mark our builtins that are constructors, and allow those, but use the array fallback for other builtins, calling user functions and bubbling up if they throw. This is probably good enough for the time being though, as writing something like: function Test() { throw "Foo"; } Array.of.call(Test) ... is probably not very likely, compared to more "usual" use. Change-Id: Ied341a7fa9c3a7fd907e2815c019bc431171ce62 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix multi line string literals using backquotesLars Knoll2018-05-261-0/+12
| | | | | | | | | | | | Task-number: QTBUG-67476 Change-Id: Ia8c6863ad35c8a92298e5dffd750d17628200573 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-263-224/+286
|\| | | | | | | Change-Id: I626068886d4440b569dbeb1789b1ebfa480000c5
| * QML Debugger: Don't crash when encoding JSON dataUlf Hermann2018-05-251-1/+62
| | | | | | | | | | | | | | | | | | Apparently QVariant::save cannot deal with QJsonObject and friends. Transform them into QVariants before sending them over the wire. Task-number: QTBUG-68474 Change-Id: I8fc9fade4915c2b40f8d16aea51ea6ff65247dc1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix crash when modifying list model in worker threadSimon Hausmann2018-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we call get() on a model in a worker thread, we may end up creating a ModelNodeMetaObject (aka cacheObject). Subsequent mutation of properties may make us end up in emitDirectNotifies(). However since we can't have bindings in there, we should shortcut/suppress the notify emission, which we can do by checking ddata->context via qmlEngine(). The previous code crashed when qmlEngine() return a null pointer but QQmlEnginePrivate::get(const QQmlEngine *) would attempt to dereference the parameter. Started-by: Slava Monich<slava.monich@jolla.com> Change-Id: I880619c686436c053692faafa5dba2c96c2ace96 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Slava Monich <slava.monich@jolla.com>
| * tst_gradient.qml: fix warnings about multiple var declarationsMitch Curtis2018-05-241-115/+115
| | | | | | | | | | Change-Id: Iccfb86de6f8c14d10fcf12e1b7cbd58a13754aa7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * tst_gradient.qml: fix warnings about type coercionMitch Curtis2018-05-241-108/+108
| | | | | | | | | | Change-Id: Ic3ab7cb4fa1772a0d92c06285f9cddf3378bd411 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | qv4arrayobject: Implement Array.prototype.includes from ES7Robin Burchell2018-05-251-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We also add a sameValueZero helper, to make life easier. Remaining failures: built-ins/Array/prototype/includes/get-prop.js fails (due to missing Proxy) built-ins/Array/prototype/includes/length-boundaries.js fails length-boundaries failure is due to strange treatment of edge number values in Value, I think, I haven't yet been able to rectify that one. Change-Id: Idacca528d88fb052d19a5d244662927f502f20d2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | qv4arrayobject: Implement Array.prototype.fill according to ES7Robin Burchell2018-05-251-13/+0
| | | | | | | | | | | | Task-number: QTBUG-56824 Change-Id: Ib12b9fe5ebdd5375f17cf4927eb9b4e292731932 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | TableView: check if the model can produce items before loadingRichard Moe Gustavsen2018-05-252-0/+45
| | | | | | | | | | | | | | | | | | | | If you assign a non-empty model, the model can still return a count of zero if something else is amiss, like the delegate being null. So we need to do en extra check for this before we load the first top-left item, otherwise we'll hit an assert later in the loading process. Change-Id: I747868faf7955b8784b2957505ae03e5b1aa0b45 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Implement Object.is and Object.getOwnPropertySymbolsLars Knoll2018-05-241-24/+0
| | | | | | | | | | Change-Id: Id64f91f6bf1abbcfa28590a43fb4f8673db6730b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix the inheritance structure for typed arraysLars Knoll2018-05-241-124/+0
| | | | | | | | | | Change-Id: I8a16c1f5e0252b4ea85ff8f623beb39df747e383 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix JSON[Symbol.toStringTag]Lars Knoll2018-05-241-1/+0
| | | | | | | | | | Change-Id: I33c29cc4d023be4ee996a4dc1fb4356da59e60d6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix Function.prototype.nameLars Knoll2018-05-241-1/+0
| | | | | | | | | | Change-Id: I2ace040cc8f65d34412909bf677252b097ab0aa3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix the length property of various functionsLars Knoll2018-05-241-32/+0
| | | | | | | | | | Change-Id: Ic782c8c9e211db25ac9e51840957db72ac1116fb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLars Knoll2018-05-2418-3/+209
|\| | | | | | | Change-Id: I0127f2c16de1d930bdd8cbccd42ec6785f31ab96