forked from qt-creator/qt-creator
QmlProfiler: Reset the serverRecording flag when the connection drops
Otherwise the run control will believe that the application is still running. Change-Id: I16ec9762362f526bd89eb21ceb82b89b295d7b5c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -427,5 +427,29 @@ void QmlProfilerClientManagerTest::testStopRecording()
|
||||
// Delete while still connected, for added fun
|
||||
}
|
||||
|
||||
void QmlProfilerClientManagerTest::testConnectionDrop()
|
||||
{
|
||||
QUrl socketUrl = urlFromLocalSocket();
|
||||
QmlProfilerClientManager clientManager;
|
||||
|
||||
{
|
||||
clientManager.setRetryParams(10, 10);
|
||||
clientManager.setProfilerStateManager(&stateManager);
|
||||
clientManager.setModelManager(&modelManager);
|
||||
clientManager.connectToServer(socketUrl);
|
||||
|
||||
QScopedPointer<QLocalSocket> socket(new QLocalSocket(this));
|
||||
socket->connectToServer(socketUrl.path());
|
||||
QVERIFY(socket->isOpen());
|
||||
fakeDebugServer(socket.data());
|
||||
|
||||
// Fake a trace. We want to test that this is reset when the connection drops.
|
||||
stateManager.setServerRecording(true);
|
||||
QTRY_VERIFY(clientManager.isConnected());
|
||||
}
|
||||
|
||||
QTRY_VERIFY(!stateManager.serverRecording());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlProfiler
|
||||
|
||||
Reference in New Issue
Block a user