From 69a1bf164822fe50ced9db1429446e7e84357c1b Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Mon, 12 Mar 2012 10:19:05 +0100 Subject: [PATCH] QmlDebugging: Modify test JSDebug test cases Add signals that are emitted on debugger responses for flaky auto tests. Change-Id: Ic59f559083b2b19fb8eec920dcb76f23125639a8 Reviewed-by: Kai Koehne --- tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 16 ++++++++++++---- 1 file 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 9cd021d..f4a9a4a 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(); -- 2.7.4