aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-02-13 19:03:40 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-02-14 21:00:40 +0100
commit751e92d50a23d1273af42a7a7836bb2eb336eced (patch)
tree83e0b647ae1c2dc8345df8a989cc24061cdd0a80 /tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
parentdd6ffbec2496920b1bfe4f29cca1eba82e959869 (diff)
V4 Debugger: Properly set up context object for expressions
We need to use the object in question as context object in order to access its properties. Otherwise we can only access the context properties and, incidentally, the root scope's properties. The latter is why the test didn't fail. Fixes: QTBUG-82150 Change-Id: I1f18f9e78dd61786310fd75e0695929522a4c90c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp')
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
index 3f424d16f2..91470e0651 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -896,6 +896,16 @@ void tst_QQmlDebugJS::evaluateInContext()
QVERIFY(waitForClientSignal(SIGNAL(result())));
QTRY_COMPARE(responseBody(m_client).value("value").toInt(), 20);
+
+ auto childObjects = object.children;
+ QVERIFY(childObjects.count() > 0); // QQmlComponentAttached is also in there
+ QCOMPARE(childObjects[0].className, QString::fromLatin1("Item"));
+
+ // "b" accessible in context of surrounding (child) object
+ m_client->evaluate(QLatin1String("b"), -1, childObjects[0].debugId);
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
+
+ QTRY_COMPARE(responseBody(m_client).value("value").toInt(), 11);
}
void tst_QQmlDebugJS::getScripts()