diff options
Diffstat (limited to 'tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp')
-rw-r--r-- | tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index 9cd021d5e9..f4a9a4add7 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -303,6 +303,8 @@ signals: void breakAfterCompileRequested(); void result(); void stopped(); + void scriptsResult(); + void evaluateResult(); private: void sendMessage(const QByteArray &); @@ -939,6 +941,12 @@ void QJSDebugClient::messageReceived(const QByteArray &data) } else { // DO NOTHING } + //Emit separate signals for scripts ane evaluate + //as the associated test cases are flaky + if (debugCommand == "scripts") + emit scriptsResult(); + if (debugCommand == "evaluate") + emit evaluateResult(); } else if (type == QLatin1String(EVENT)) { QString event(value.value(QLatin1String(EVENT)).toString()); @@ -1685,8 +1693,8 @@ void tst_QQmlDebugJS::evaluateInGlobalScope() QVERIFY(init()); client->connect(); - client->evaluate(QLatin1String("print('Hello World')"), true); - QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(result()))); + client->evaluate(QLatin1String("console.log('Hello World')"), true); + QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(evaluateResult()))); //Verify the value of 'print' QString jsonString(client->response); @@ -1720,7 +1728,7 @@ void tst_QQmlDebugJS::evaluateInLocalScope() int frameIndex = body.value("index").toInt(); client->evaluate(QLatin1String("root.a"), frameIndex); - QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(result()))); + QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(evaluateResult()))); //Verify the value of 'timer.interval' jsonString = client->response; @@ -1759,7 +1767,7 @@ void tst_QQmlDebugJS::getScripts() client->connect(); client->scripts(); - QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(result()))); + QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(scriptsResult()))); QString jsonString(client->response); QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); |