aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qqmlprofilerservice
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-09 14:32:32 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-09 14:32:32 +0100
commite3f7da72ac5b4540f88bb5cbd91a4917ba84334a (patch)
tree3f05c1cf965fe291685c383f04b0bec87b05095b /tests/auto/qml/debugger/qqmlprofilerservice
parent4cc883452b37dbe3148064150dc2f6b282b6b816 (diff)
parent2e8a45d99f94cbd2c805dd3de56d60d9baa9bd4e (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: .qmake.conf src/qml/memory/qv4mm.cpp src/qml/qml/qqmlbinding.cpp Change-Id: I98e51ef5af12691196da5772a07d3d53d213efcc
Diffstat (limited to 'tests/auto/qml/debugger/qqmlprofilerservice')
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/data/memory.qml17
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro5
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp22
3 files changed, 42 insertions, 2 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/memory.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/memory.qml
new file mode 100644
index 0000000000..f39dcdf16a
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/memory.qml
@@ -0,0 +1,17 @@
+import QtQml 2.0
+
+Timer {
+ interval: 1
+ running: true
+
+ function recurse(i) {
+ var x = { t: [1, 2, 3, 4] }
+ console.log(x.t[i]);
+ if (i < 3)
+ recurse(i + 1);
+ else
+ Qt.quit();
+ }
+
+ onTriggered: recurse(0)
+}
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
index a26f48e6c7..7c78b5fcb3 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
@@ -8,7 +8,7 @@ include(../shared/debugutil.pri)
TESTDATA = data/*
-QT += core qml testlib gui-private core-private
+QT += core qml testlib testlib-private gui-private core-private
OTHER_FILES += \
data/pixmapCacheTest.qml \
@@ -20,4 +20,5 @@ OTHER_FILES += \
data/signalSourceLocation.qml \
data/javascript.qml \
data/timer.qml \
- data/qstr.qml
+ data/qstr.qml \
+ data/memory.qml
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 1bf700aea4..43ab3e1171 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -34,6 +34,7 @@
#include <private/qqmldebugconnection_p.h>
#include <QtTest/qtest.h>
+#include <private/qtestresult_p.h>
#include <QtCore/qlibraryinfo.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -303,6 +304,7 @@ private slots:
void javascript();
void flushInterval();
void translationBinding();
+ void memory();
};
#define VERIFY(type, position, expected, checks) QVERIFY(verify(type, position, expected, checks))
@@ -731,6 +733,26 @@ void tst_QQmlProfilerService::translationBinding()
CheckDetailType | CheckMessageType);
}
+void tst_QQmlProfilerService::memory()
+{
+ connect(true, "memory.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
+
+ m_client->sendRecordingStatus(true);
+
+ checkTraceReceived();
+ checkJsHeap();
+
+ int smallItems = 0;
+ for (auto message : m_client->jsHeapMessages) {
+ if (message.detailType == QV4::Profiling::SmallItem)
+ ++smallItems;
+ }
+
+ QVERIFY(smallItems > 5);
+}
+
QTEST_MAIN(tst_QQmlProfilerService)
#include "tst_qqmlprofilerservice.moc"