aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qqmlprofilerservice
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-24 16:37:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-01-24 18:27:41 +0100
commit22041acdfe85c9a9b814e11cd86e8ee5a55be82d (patch)
tree1b4d1bfa0ebba9e5d1495b5ca7055dba94642c46 /tests/auto/qml/debugger/qqmlprofilerservice
parent6ae57f01bb1495a74b23a81c590672ce788d5400 (diff)
parent2407cd29e628671f7f5144e0d241d4249a3ab612 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/imports/dialogs/qquickmessagedialog.cpp src/imports/dialogs/qquickmessagedialog_p.h src/qml/debugger/qqmlprofilerservice_p.h src/qml/jsruntime/qv4regexpobject.cpp tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
Diffstat (limited to 'tests/auto/qml/debugger/qqmlprofilerservice')
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/data/signalSourceLocation.qml9
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro3
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp30
3 files changed, 41 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/signalSourceLocation.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/signalSourceLocation.qml
new file mode 100644
index 0000000000..25e63669c4
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/signalSourceLocation.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ onWidthChanged: console.log(width);
+ Component.onCompleted: width = 500;
+}
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
index 87d8b647d1..647d761dc4 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
@@ -19,4 +19,5 @@ OTHER_FILES += \
data/test.qml \
data/exit.qml \
data/scenegraphTest.qml \
- data/TestImage_2x2.png
+ data/TestImage_2x2.png \
+ data/signalSourceLocation.qml
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 56ed65f54d..9d2e0ecbb4 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -181,6 +181,7 @@ private slots:
void scenegraphData();
void profileOnExit();
void controlFromJS();
+ void signalSourceLocation();
};
void QQmlProfilerClient::messageReceived(const QByteArray &message)
@@ -513,6 +514,35 @@ void tst_QQmlProfilerService::controlFromJS()
QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace);
}
+void tst_QQmlProfilerService::signalSourceLocation()
+{
+ connect(true, "signalSourceLocation.qml");
+ QVERIFY(m_client);
+ QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
+
+ m_client->setTraceState(true);
+ while (!(m_process->output().contains(QLatin1String("500"))))
+ QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
+ m_client->setTraceState(false);
+ QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time.");
+
+ // must start with "StartTrace"
+ QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event);
+ QCOMPARE(m_client->traceMessages.first().detailType, (int)QQmlProfilerClient::StartTrace);
+
+ QVERIFY(m_client->traceMessages[14].detailData.endsWith("signalSourceLocation.qml"));
+ QVERIFY(m_client->traceMessages[14].line == 8);
+ QVERIFY(m_client->traceMessages[14].column == 28);
+
+ QVERIFY(m_client->traceMessages[16].detailData.endsWith("signalSourceLocation.qml"));
+ QVERIFY(m_client->traceMessages[16].line == 7);
+ QVERIFY(m_client->traceMessages[16].column == 21);
+
+ // must end with "EndTrace"
+ QCOMPARE(m_client->traceMessages.last().messageType, (int)QQmlProfilerClient::Event);
+ QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace);
+}
+
QTEST_MAIN(tst_QQmlProfilerService)
#include "tst_qqmlprofilerservice.moc"