aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-291-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+6353
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>