Qml Tooling: Test that trace events arrive in chronological order

The QML profiler trace client should resolve any deviations from
chronological order. Trace receivers should not need to deal with this.

Change-Id: I9bbb387bbb5c0b7da9f2b508d228665af9f27d4c
Reviewed-by: Michael Brasser <michael.brasser@live.com>
This commit is contained in:
Ulf Hermann 2018-11-01 11:06:34 +01:00
parent 71645c45b9
commit 87265c7ab8
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,9 @@ public:
int numLoadedEventTypes() const override;
void addEventType(const QQmlProfilerEventType &type) override;
void addEvent(const QQmlProfilerEvent &event) override;
private:
qint64 lastTimestamp = -1;
};
void QQmlProfilerTestClient::startTrace(qint64 timestamp, const QList<int> &engineIds)
@ -102,6 +105,9 @@ void QQmlProfilerTestClient::addEvent(const QQmlProfilerEvent &event)
const QQmlProfilerEventType &type = types[typeIndex];
QVERIFY(event.timestamp() >= lastTimestamp);
lastTimestamp = event.timestamp();
switch (type.message()) {
case Event: {
switch (type.detailType()) {