aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsvalue
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.Friedemann Kleint2015-09-022-2/+1
| | | | | | | Fix usage of API that is marked deprecated. Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-291-7/+7
| | | | | | | | | | | | - 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>
* Update copyright headersJani Heikkinen2015-02-122-14/+14
| | | | | | | | | 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>
* Fix mapping of JS objects/arrays to C++Simon Hausmann2014-09-171-6/+44
| | | | | | | | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] When a JavaScript object/array is passed to C++ through a QVariant, the engine no longer immediately converts the object recursively into a QVariantMap or QVariantList but instead stores a QJSValue in the QVariant. This prevents a loss of data when the JS object contains non-primitive types such as function objects for example. Code that expects the variant type to be exactly QVariant::Map or QVariant::List may need to be adapted. Registered conversion functions however ensure that code that merely calls toMap() or toList() continues to work. Task-number: QTBUG-40431 Change-Id: I1dbc1d5f8e78ad28bb62db3681b9a0b34557e7f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-252-38/+22
| | | | | | | | | - 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>
* Fix === operator for value typesLars Knoll2013-11-151-1/+1
| | | | | | | | | Fix === comparison for urls and other QML value types. Task-number: QTBUG-33546 Change-Id: I4a7066e6bbc7de7c599fe2c7b2fdfb75e0ff5196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Properly implement Object.prototype.__proto__Lars Knoll2013-06-131-1/+1
| | | | | Change-Id: I5c3247f46cd86020425f6df8674f8bda7410757b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a few more QJSValue autotestsLars Knoll2013-06-071-1/+0
| | | | | Change-Id: Ie870da8f6b8f9e34221bbfd10f328df1dc363294 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix various errors in the qjsvalue auto testLars Knoll2013-06-071-13/+0
| | | | | | | | | | | | | | Fix creation of Array's from a QStringList Properly implement toVariant() Fix VariantObject::toString() Fix conversion of variant lists to JS values Remove an XFAIL Allow comparison of QJSValue objects created from different engines. There's no reason why we can't simply do this with v4. Change-Id: I8d8c597dbb032926501508d60bd80622ec964d67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Small fixes to auto testLars Knoll2013-04-191-0/+1
| | | | | Change-Id: Ie18a15601b27c551a2baf13d0f57f72d711dcef2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement most of QJSEngine against V4Lars Knoll2013-04-191-1/+1
| | | | | | | | Also do various fixes in other places, so more of the QJS* autotests pass Change-Id: I39662a2ca1441f778595d260860375c5c628bf8e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-102-2/+2
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Declare QJSValue as a metatype where it is defined.Stephen Kelly2012-12-041-1/+0
| | | | | | | Instead of in multiple different TUs, therefore causing ODR violations. Change-Id: I08d3624d3ed5a995e96488361665afa197fb9fc9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-232-48/+48
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Don't put JavaScript-owned objects on the stack.Thomas McGuire2012-08-241-2/+2
| | | | | | | | | Only the fact that the object wrapper uses deleteLater() instead of delete made this not crash. Change-Id: I034d8c7f24b963be9e031446ffdfa33e6bc266cc Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.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>
* Add gui-private to testsGirish Ramakrishnan2012-06-221-1/+1
| | | | | | | QWindowSystemInterface will be marked as QPA API. Change-Id: Id174a24f8432219adf1425efe1eb59cf67d48bb9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Clean up QJSValue tests.Mitch Curtis2012-05-302-1123/+4
| | | | | Change-Id: I967facfbd0b738c3a2938904a094f6312be5dcef Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-281-0/+1
| | | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I16407d68c583e6e9b8ef9c536cfee156d56bd2e2 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Remove QJS exception APIKent Hansen2012-05-031-24/+8
| | | | | | | | | | | | | | | | | This API has been deprecated for a while. It's legacy stuff from QtScript. Until someone proves that QJSValue::isError() isn't sufficient to handle JavaScript exceptions, we won't provide any additional API for that. Also removed QJSValuePrivate::lessThan(), which was using the exception mechanism, but the function itself wasn't used anymore (another remnant from the QtScript days). Change-Id: I3dffc6a7835874153f90d25ae2a72c93ea6db39a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QVariant conversion for JS null type symmetricKent Hansen2012-03-201-2/+10
| | | | | | | | | | | | | | | | If you pass (void*)0 to QJSEngine::toScriptValue(), or you pass a QVariant of type QMetaType::VoidStar containing a 0 value, you get back a QJSValue of type null (isNull() returns true); that's fine. However, if you called QJSValue::toVariant() on a JS null value, you would get back an invalid QVariant. The expected result is a QVariant of type QMetaType::VoidStar containing a 0 value. This makes the conversion of the JS null type symmetric and avoids loss of data. Change-Id: Ifa6e788152118f80adf9c2d7be1283f053b44294 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Don't allow tst_QJSEngine or tst_QJSValue instance to be collectedChris Adams2012-03-151-13/+21
| | | | | | | | | Both of those unit tests currently change the ownership of the test instance object, which could result in it being collected by the JS GC and deleted if events were processed. Change-Id: I5a9821fb56e19af1d52fea46e54755875dfbb29a Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-243-0/+3865
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>