diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-05 09:59:18 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-06-05 10:56:10 +0200 |
commit | fd01eb1797221fbcc983ed5d4ff644cecdba5e42 (patch) | |
tree | 898ad6300aef2ee48dc622dd0cc427f47dbf0539 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | |
parent | f0e32d311a791910acef672b1ab9a2ac4a80171e (diff) |
Improve type error messages when reading properties
This fixes the expected output of the qobjectConnectionListExceptionHandling and
while we're at it this patch also re-enables the importScripts test. The test
expects similar output that now passes. importScripts_data produces two failures
though, that are unrelated to expected error message but indicate real bugs.
Change-Id: I606b8791524d19a4bb20a81c30abc2285a1a0a0f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 14dc6d9e52..93621365d5 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -50,6 +50,7 @@ #include <QtCore/qnumeric.h> #include <private/qqmlengine_p.h> #include <private/qqmlvmemetaobject_p.h> +#include <private/qqmlcontextwrapper_p.h> #include "testtypes.h" #include "testhttpserver.h" #include "../../shared/util.h" @@ -157,10 +158,8 @@ private slots: void singletonTypeCaching(); void singletonTypeImportOrder(); void singletonTypeResolution(); -#if 0 void importScripts_data(); void importScripts(); -#endif void scarceResources(); void scarceResources_data(); void scarceResources_other(); @@ -295,7 +294,7 @@ private slots: private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); -// static void verifyContextLifetime(QQmlContextData *ctxt); + static void verifyContextLifetime(QQmlContextData *ctxt); QQmlEngine engine; }; @@ -3778,27 +3777,26 @@ void tst_qqmlecmascript::singletonTypeResolution() delete object; } -#if 0 void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) { QQmlContextData *childCtxt = ctxt->childContexts; if (!ctxt->importedScripts.isEmpty()) { QV8Engine *engine = QV8Engine::get(ctxt->engine); - foreach (v8::Persistent<v8::Object> qmlglobal, ctxt->importedScripts) { + foreach (const QV4::PersistentValue& qmlglobal, ctxt->importedScripts) { QQmlContextData *scriptContext, *newContext; - if (qmlglobal.IsEmpty()) + if (qmlglobal.isEmpty()) continue; - scriptContext = engine->contextWrapper()->context(qmlglobal); + scriptContext = QV4::QmlContextWrapper::getContext(qmlglobal); { - v8::Handle<v8::Object> temporaryScope = engine->qmlScope(scriptContext, NULL); + QV4::Value temporaryScope = QV4::QmlContextWrapper::qmlScope(engine, scriptContext, 0); Q_UNUSED(temporaryScope) } engine->gc(); - newContext = engine->contextWrapper()->context(qmlglobal); + newContext = QV4::QmlContextWrapper::getContext(qmlglobal); QVERIFY(scriptContext == newContext); } } @@ -3809,9 +3807,7 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) { childCtxt = childCtxt->nextChild; } } -#endif -#if 0 void tst_qqmlecmascript::importScripts_data() { QTest::addColumn<QUrl>("testfile"); @@ -4054,7 +4050,6 @@ void tst_qqmlecmascript::importScripts() engine.setImportPathList(importPathList); } -#endif void tst_qqmlecmascript::scarceResources_other() { |