diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-01 11:08:26 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-14 08:44:39 +0000 |
commit | 8af9d69554065924f9c92b29dd09d08ba6650328 (patch) | |
tree | 9244b642cf5db61ab81281eef1671bb5d15a9caf /tests | |
parent | dcf41b5f69d0e199d0a6a8faaad981f73e1c9aa0 (diff) |
QML Tooling: Fix ordering of memory events in V4 profiler adapter
We should not send memory events that are chronologically after the next
call event, even if the time threshold given by the profiler service
would allow us to do so. When the remaining call events are sent, the
chronological order would otherwise be violated.
Fixes: QTBUG-71515
Change-Id: Iee27304f836a899b2b35133316cecd3d34f128c6
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests')
3 files changed, 32 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/batchOverflow.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/batchOverflow.qml new file mode 100644 index 0000000000..dde1def947 --- /dev/null +++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/batchOverflow.qml @@ -0,0 +1,20 @@ +import QtQml 2.2 + +QtObject { + function iterate(dictionaryTable, j) { + var word = "a" + j.toString() + dictionaryTable[word] = null; + } + + Component.onCompleted: { + var dictionaryTable = {}; + for (var j = 0; j < 256; ++j) + iterate(dictionaryTable, j); + } + + property Timer timer: Timer { + interval: 1 + running: true; + onTriggered: Qt.quit(); + } +} diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro index 2a685ed877..0cd4b331f2 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro +++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro @@ -21,4 +21,5 @@ OTHER_FILES += \ data/javascript.qml \ data/timer.qml \ data/qstr.qml \ - data/memory.qml + data/memory.qml \ + data/batchOverflow.qml diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index eb0b0c2fe2..7fc43671c2 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -225,6 +225,7 @@ private slots: void memory(); void compile(); void multiEngine(); + void batchOverflow(); private: bool m_recordFromStart = true; @@ -826,6 +827,15 @@ void tst_QQmlProfilerService::multiEngine() QCOMPARE(spy.count(), 1); } +void tst_QQmlProfilerService::batchOverflow() +{ + // The trace client checks that the events are received in order. + QCOMPARE(connect(true, "batchOverflow.qml"), ConnectSuccess); + checkProcessTerminated(); + checkTraceReceived(); + checkJsHeap(); +} + QTEST_MAIN(tst_QQmlProfilerService) #include "tst_qqmlprofilerservice.moc" |