aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-10-27 11:30:43 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-11-07 11:06:58 +0000
commita5d31af1a58a2c833ed3ee91dd9140ab23fc8e8a (patch)
treeda3e33a1053a9ef46d5d04da17c5865953460e6d /tests/auto/qml/debugger
parent425edd90acfbb81b50f63db7f60927dcae197dfd (diff)
Fix evaluation of V4 debug jobs
There may not be a current stack frame and there may not be a function in either the current frame or the global scope. Change-Id: I15daf10586cf8895a9a80ccc3dd4bf4117a947c5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/debugger')
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
index be9b04b204..3cd359cf48 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -1329,22 +1329,20 @@ void tst_QQmlDebugJS::getScopeDetails()
void tst_QQmlDebugJS::evaluateInGlobalScope()
{
- QSKIP("fixme");
//void evaluate(QString expr, int frame = -1);
QCOMPARE(init(true), ConnectSuccess);
m_client->connect();
- do {
+ for (int i = 0; i < 10; ++i) {
// The engine might not be initialized, yet. We just try until it shows up.
m_client->evaluate(QLatin1String("console.log('Hello World')"));
- } while (!QQmlDebugTest::waitForSignal(m_client, SIGNAL(result()), 500));
+ if (QQmlDebugTest::waitForSignal(m_client, SIGNAL(result()), 500))
+ break;
+ }
//Verify the return value of 'console.log()', which is "undefined"
- QString jsonString(m_client->response);
- QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
- QVariantMap body = value.value("body").toMap();
- QCOMPARE(body.value("type").toString(),QLatin1String("undefined"));
+ QCOMPARE(responseBody(m_client).value("type").toString(), QLatin1String("undefined"));
}
void tst_QQmlDebugJS::evaluateInLocalScope()
@@ -1386,7 +1384,6 @@ void tst_QQmlDebugJS::evaluateInLocalScope()
void tst_QQmlDebugJS::evaluateInContext()
{
- QSKIP("fixme");
m_connection = new QQmlDebugConnection();
m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath)
+ "/qmlscene", this);
@@ -1430,11 +1427,7 @@ void tst_QQmlDebugJS::evaluateInContext()
m_client->evaluate(QLatin1String("a + 10"), -1, object.debugId);
QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
- QString jsonString = m_client->response;
- QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
-
- QVariantMap body = value.value("body").toMap();
- QTRY_COMPARE(body.value("value").toInt(), 20);
+ QTRY_COMPARE(responseBody(m_client).value("value").toInt(), 20);
}
void tst_QQmlDebugJS::getScripts()