QmlProfiler: Drop static accessors from QmlProfilerTool

It wasn't really a singleton even before. For testing purposes make the
client/state/model managers accessible.

Change-Id: Ie5efbc47a6b9119495f999e4e05877d4789da407
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2018-01-09 14:50:12 +01:00
parent 7d039de7a8
commit e1ad7a1784
7 changed files with 89 additions and 67 deletions

View File

@@ -39,7 +39,7 @@ namespace Internal {
void QmlProfilerToolTest::testAttachToWaitingApplication()
{
QmlProfilerTool *profilerTool = QmlProfilerTool::instance();
QmlProfilerTool profilerTool(nullptr);
QTcpServer server;
QUrl serverUrl = Utils::urlFromLocalHostAndFreePort();
QVERIFY(serverUrl.port() >= 0);
@@ -63,7 +63,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication()
});
timer.start();
ProjectExplorer::RunControl *runControl = profilerTool->attachToWaitingApplication();
ProjectExplorer::RunControl *runControl = profilerTool.attachToWaitingApplication();
QVERIFY(runControl);
QTRY_VERIFY(connection);