diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2012-03-12 14:08:56 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-19 10:49:45 +0100 |
commit | cad5df2572d023d1d8ab213d7e736f8d15576916 (patch) | |
tree | a6622cb4597020a1da4be95de1dc47bc97529811 /tests | |
parent | af3a8708b46e8ae6e177dcee028364bd9fd285cd (diff) |
QmlDebugging: Object Tree and States List
All created instances are stored under the root context.
Check for the creation context of the object when building
up the tree. Do the same when building up the states list.
Change-Id: I8716d9966a61b8f7cb3ad4b7ab5acd4c94b4cd03
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index 9756313905..e409f3c8b6 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -137,11 +137,15 @@ QQmlDebugObjectReference tst_QQmlEngineDebugService::findRootObject(int context, QQmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); - if (q_context->rootContext().objects().count() == 0) + if (q_context->rootContext().contexts().count() == 0 || + q_context->rootContext().contexts().last().objects().count() == 0) return QQmlDebugObjectReference(); + + //Contexts are in a stack + int count = q_context->rootContext().contexts().count(); QQmlDebugObjectQuery *q_obj = recursive ? - m_dbg->queryObjectRecursive(q_context->rootContext().objects()[context], this) : - m_dbg->queryObject(q_context->rootContext().objects()[context], this); + m_dbg->queryObjectRecursive(q_context->rootContext().contexts()[count - context - 1].objects()[0], this) : + m_dbg->queryObject(q_context->rootContext().contexts()[count - context - 1].objects()[0], this); waitForQuery(q_obj); QQmlDebugObjectReference result = q_obj->object(); @@ -493,8 +497,9 @@ void tst_QQmlEngineDebugService::watch_object() QQmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); - QVERIFY(q_context->rootContext().objects().count() > 0); - QQmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); + QVERIFY(q_context->rootContext().contexts().count()); + QVERIFY(q_context->rootContext().contexts().last().objects().count() > 0); + QQmlDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().contexts().last().objects()[0], this); waitForQuery(q_obj); QQmlDebugObjectReference obj = q_obj->object(); @@ -705,12 +710,9 @@ void tst_QQmlEngineDebugService::queryRootContexts() QCOMPARE(context.debugId(), QQmlDebugService::idForObject(actualContext)); QCOMPARE(context.name(), actualContext->objectName()); - QCOMPARE(context.objects().count(), 4); // 4 qml component objects created for context in main() - // root context query sends only root object data - it doesn't fill in // the children or property info - QCOMPARE(context.objects()[0].properties().count(), 0); - QCOMPARE(context.objects()[0].children().count(), 0); + QCOMPARE(context.objects().count(), 0); QCOMPARE(context.contexts().count(), 5); QVERIFY(context.contexts()[0].debugId() >= 0); @@ -734,7 +736,7 @@ void tst_QQmlEngineDebugService::queryObject() QQmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); - QQmlDebugObjectReference rootObject = q_context->rootContext().objects()[0]; + QQmlDebugObjectReference rootObject = q_context->rootContext().contexts().last().objects()[0]; QQmlDebugObjectQuery *q_obj = 0; @@ -815,7 +817,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult() QQmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); - int objectId = q_context->rootContext().objects()[0].debugId(); + int objectId = q_context->rootContext().contexts().last().objects()[0].debugId(); QQmlDebugExpressionQuery *q_expr; @@ -1164,8 +1166,9 @@ void tst_QQmlEngineDebugService::queryObjectTree() QQmlDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); waitForQuery(q_context); - QVERIFY(q_context->rootContext().objects().count() > sourceIndex); - QQmlDebugObjectReference rootObject = q_context->rootContext().objects()[sourceIndex]; + QVERIFY(q_context->rootContext().contexts().count() >= sourceIndex); + int count = q_context->rootContext().contexts().count(); + QQmlDebugObjectReference rootObject = q_context->rootContext().contexts()[count - sourceIndex - 1].objects()[0]; QQmlDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(rootObject, this); waitForQuery(q_obj); |