aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine
Commit message (Collapse)AuthorAgeFilesLines
* [ChangeLog][QtQml] Fix JavaScript Array.pop() not updating the internal ↵Simon Hausmann2014-01-071-0/+13
| | | | | | | | | | | | | array length correctly While the length property was reporting the correct value, the internal array length was out-of-sync. Task-number: QTBUG-35979 Change-Id: I68820a349cf1ce88c6aabc6a2301a8a861018a10 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix a crash in JSON.parseLars Knoll2013-12-041-0/+8
| | | | | | | | | | Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Turn on exact garbage collection by defaultLars Knoll2013-10-161-22/+5
| | | | | | | | | Keep conservative GC as a fallback for testing Enable all tests again that were skipped due to GC issues. Change-Id: I8e0fa728207bdd39a96d0acf95e27841157d8402 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove milliseconds before comparing JS + Qt date strings.Mitch Curtis2013-09-201-0/+2
| | | | | | | | | It seems that tst_qjsengine also needs: https://codereview.qt-project.org/#change,65811 Change-Id: I5f5586f004dec047c3a1edebbc98d7ecde195bfd Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Revert "Temporarily disable tst_QJSEngine tests [...]"Mitch Curtis2013-09-201-28/+24
| | | | | | | | | This reverts commit 17ae095602bf36ece892598e69f794ef982c603b. The test can be re-enabled now. Change-Id: I0134365edbfd4aed05665bf16b8e15221fe62d67 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Temporarily disable tst_QJSEngine tests to allow qtbase dev integrationMitch Curtis2013-09-181-24/+28
| | | | | | | | | | | Temporarily disables: - tst_QJSEngine::dateConversionJSQt() - tst_QJSEngine::dateConversionQtJS() so that https://codereview.qt-project.org/#change,65560 can merge. Change-Id: I415daf1c5bd137e1905773f88fe5ebaaab1e0a06 Reviewed-by: John Layt <jlayt@kde.org>
* Skip unstable testsLars Knoll2013-09-181-0/+2
| | | | | | | | | | We can't test GC reliably due to our GC being conservative currently. Once we moved over to an exact GC, we can re-enable the test. Change-Id: I6778ed9bee3b41372705f6b41c1379d224335e53 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow for function declarations inside conditionalsSimon Hausmann2013-08-231-0/+18
| | | | | | | | | This is strictly speaking a regression from 5.1/v8, which allows for that as real world JavaScript appears to require it. Task-number: QTBUG-33064 Change-Id: Iceaca84373f12fb08459ed007afb25b5a705fa31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix another bug with automatic semicolon insertionSimon Hausmann2013-08-081-0/+5
| | | | | | | Avoid empty statements after else. Change-Id: Ia7782a3371bc79c7e93857aa252309d2824a5a9e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix some GC related tests to work with MSVCSimon Hausmann2013-08-061-3/+15
| | | | | | | | Using alloca instead of memset we can convince even MSVC to allocate memory on the stack, to overwrite any previous dead V4 pointers. Change-Id: Ic01bebfc6368e9c3ce1f6155a0f0ea206b90764c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Skip the date time conversion tests on WindowsSimon Hausmann2013-08-051-0/+9
| | | | | | | | There's an issue in QDateTime, now that we're using that in our ECMAScript date implementation... Change-Id: I7599900a670097623d1b7e5b9bb086ef43d6e7e6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix automatic semicolon insertion. Again.Erik Verbruggen2013-07-021-4/+0
| | | | | | | | | | After a do-token, no automatic semicolon can be inserted, because that would result in an empty statement. The issue was that the correct state was set when a do-token was found, but the state updating logic would immediately reset it back, resulting in a semicolon insertion. Change-Id: If867510dfaa182d0fe8b73a5bb1cab299c4faecc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Don't remove milliseconds now that toString() includes them.Mitch Curtis2013-06-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a test failure introduced by 15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c. tst_QJSEngine::dateConversionJSQt and tst_QJSEngine::dateConversionQtJS removed milliseconds from the JS-converted datetime, as QTime::toString() previously did not include them. Now it does, so we can remove this code. Change-Id: I48604a2eb4ed854665c9c9a24ba7b03657fea116 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * Doc: Fix module name formatSze Howe Koh2013-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Qt3D -> Qt 3D QtLocation -> Qt Location QtScript -> Qt Script Change-Id: Id59cb209e0e0407d564de0bfaab73990e64a02e6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Fix module name formatSze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtGui -> Qt GUI QtMultimedia -> Qt Multimedia QtScript -> Qt Script QtSensors -> Qt Sensors QtSvg -> Qt SVG QtWebkit -> Qt WebKit Also fix a broken link to "Qt WebKit QML Types" Change-Id: Ica6081024d3957a3ca2ef3d870f623506c69d877 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Mark automatic-semicolon insertion bugs as XFAILSimon Hausmann2013-06-241-0/+4
| | | | | | | | | | | | | | (but marked as needs-fix in trello) Change-Id: I7cfebc9494dd0d5cb027b36f8c8cbcd02a520302 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Comment out test of octal numbersLars Knoll2013-06-141-3/+3
| | | | | | | | | | | | | | We don't currently support octal numbers in v4 Change-Id: Icb31d399a199eb573068b431954a22d169de9b9e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Implement error.fileName and error.lineNumberLars Knoll2013-06-141-3/+0
| | | | | | | | | | | | | | | | | | Useful extensions to the error object. This also helped track down a few places in the parser where we wouldn't give correct error information. Change-Id: Id03653e096216e097c13a7a6e698ca142d92da13 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove test case that violates the ecma specLars Knoll2013-06-131-42/+0
| | | | | | | | | | | | | | | | It's actually also hard for us to support this properly, so let's simply not do it. Change-Id: I107e1c1f482d64c9d4d58c805e0446e76e85d840 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix test caseLars Knoll2013-06-131-1/+1
| | | | | | | | | | | | | | | | | | The for..in statements behavior is actually undefined when it comes to inserting values into the object being iterated over. Simply adjust the test case to the v4 behavior. Change-Id: I85774ae98810d8c14ee457138ccc54082de47802 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix test case. QDateTime actually writes milliseconds since 5.2Lars Knoll2013-06-131-2/+0
| | | | | | | | | | Change-Id: I21a7b63175b173a5036892dd932614a299d519c3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove last traces of v8 API and v8 compatibility layerSimon Hausmann2013-06-121-2/+0
| | | | | | | | | | | | | | | | The debugger and profiler service remain as bigger parts that need to be ported properly to v4. Change-Id: I68e72d6db66fe497eb58ed60df417ffe4662d115 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | convert QV8VariantWrapper to v4Lars Knoll2013-05-171-1/+0
| | | | | | | | | | | | | | | | | | Implement variant support through a QV4::VariantObject class. Port scarce resource support for the pixmap and image variants. Change-Id: Ib6aac8debc7f57224ccddb912ab4342c5f1dec15 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix keywords testLars Knoll2013-05-051-14/+3
| | | | | | | | | | | | | | The reserved keywords are allowed as property names in objects. Change-Id: I5e0025ff374e0e154df81590660fc96b5c529ea4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Some fixes to the autotestLars Knoll2013-05-051-6/+0
| | | | | | | | | | | | | | Remove an XFAIL that now passes, and some bogus code. Change-Id: I75ef6e54c5efe30e125003e9f2946f3d4e0533ea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compilation of testLars Knoll2013-05-041-102/+0
| | | | | | | | | | | | | | | | Testing interoperability between our API and v8 doesn't make any sense anymore anyway. Change-Id: Ice97c253974a49e4dd8890d69ec0d0bea19ae110 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Small fixes to auto testLars Knoll2013-04-191-1/+0
| | | | | | | | | | Change-Id: Ie18a15601b27c551a2baf13d0f57f72d711dcef2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-152-2/+2
|/ | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-171-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * 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>
* | Reenable temporarily skipped QML testsPeter Varga2013-01-091-2/+0
| | | | | | | | | | Change-Id: I1e57b0e39c539648602cc480e296db6c6948ff39 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Update some QML tests and temporarily skip themPeter Varga2013-01-091-7/+4
|/ | | | | | | | | | These tests should be skipped until the next V8 update is landed into QtJSBackend. The expected results of these tests currently check wrong behavior. These bugs have been already fixed in the official V8 thus we need to update and skip them until the fix is landed into QtJSBackend. Change-Id: I77d8ee50b45cd6599cbb5735ddef7d1461aeceab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Re-enable tst_QJSEngine::stringObjects testPeter Varga2012-10-191-4/+0
| | | | | | | | Corresponding bug has been fixed in QtJSBackend thus re-enable test and remove expected failures. Change-Id: I72d6ce31a1c932db29dad0758e0c2654543a5b1f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Temporarily skip tst_QJSEngine::stringObjects testPeter Varga2012-10-181-0/+2
| | | | | | | | Expected failures of this test block to land a patch to QtJSBackend that fixes them. Change-Id: If5c73cb668f9cc05e605e4f37c0dfabc0eecb5a8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update regex related tests of QJSEnginePeter Varga2012-10-101-15/+12
| | | | | | | | | Modify expected results based on ECMA-262 standard and current results of JSC. Task-number: QTBUG-27169 Change-Id: I705d474b2a62775860f6ff6eba8a0f6b28f50ff3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@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>
* tst_QJSEngine::jsFutureReservedWords(): QSKIP -> QEXPECT_FAILJ-P Nurmi2012-09-121-1/+10
| | | | | | Task-number: QTBUG-27193 Change-Id: Iaf0bed44374396e59ad3d7f977e3f29d7d5112ee Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Updated tst_QJSEngineJ-P Nurmi2012-09-071-9/+5
| | | | | | | | | | Replaced several QSKIP() instances with QEXPECT_FAIL() and removed execScript from the list global object properties as it has been removed from V8: http://codereview.chromium.org/7046002/ Task-number: QTBUG-27169 Change-Id: I28bbb38971ad80551ec24285a321e545db44a79d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Don't put JavaScript-owned objects on the stack.Thomas McGuire2012-08-241-3/+5
| | | | | | | | | 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 QJSEngine tests.Mitch Curtis2012-05-311-3629/+0
| | | | | Change-Id: Ia778f07a79c3354b639e25dbd847c0ff643b5418 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add internal API for accessing V8 handles of QJS typesKent Hansen2012-05-292-1/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to use the V8 API directly. This might be necessary in cases where the QJS API is missing some functionality (e.g., controlling the V8 profiler), or for performance reasons (e.g., avoiding overhead of QJSValue indirection). The V8 API is clearly more extensive than the QJS API, and QJS will likely never reach feature parity with it (since that's outside the scope of QJS). By providing access to the underlying V8 types, users can still choose to use V8 directly in the (hopefully rare) cases where the public QJS API isn't sufficient. Two new functions are introduced: - qt_QJSEngineV8Context(QJSEngine *) returns a local handle to the engine's internal V8 context. - qt_QJSValueV8Value(const QJSValue &) returns a local handle to the QJSValue's internal V8 value. The caller is responsible for - ensuring that a V8 handle scope is in place; - entering/exiting the QJSEngine's V8 context. The documentation and tests show how that can be done. Also added a benchmark for QJSValue that can be used to measure the effect of using raw V8 API for some common operations. Change-Id: I680aeb2f67ffe5eeadd432a05c8084e43921a118 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@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-26/+6
| | | | | | | | | | | | | | | | | 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>
* Avoid calling gc in QQmlEngine destructor.Jędrzej Nowacki2012-04-271-0/+14
| | | | | | | | | | | | | | GC may be expensive. GC call in QQmlEngine doesn't have much sense because V8 will destroy all objects living in a current context. The only problem is that V8 may decide to not invoke weak callbacks which may cause a memory leak. To avoid that we track all QObjects that have JavaScript ownership set and we delete them explicitly. The change reduce time of destroying QQmlEngine by 75%, which is really visible in qquicklistmodel test. Change-Id: I2a3668fd23630669114baee8c241a7ecc4100e33 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Make QVariant conversion for JS null type symmetricKent Hansen2012-03-201-0/+4
| | | | | | | | | | | | | | | | 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-9/+15
| | | | | | | | | 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>
* Changed qml tests to work from install directoryKurt Korbatits2012-03-071-8/+2
| | | | | | | | | | - Changed tests to use TESTDATA - moved qqmlcontext to private test as it contains private header - added check for cross_compile option to skip when sources not available Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>