aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/shared/debugutil.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-09-16 16:28:24 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-10-30 19:05:07 +0000
commit79ed2f70f05d30b82c0cec8843f5431cf8224f1c (patch)
tree930374460a204c5e4cae6210528998c53d350c97 /tests/auto/qml/debugger/shared/debugutil.cpp
parente1db5c660734bd8d43675469ce828944347e739b (diff)
Move QQmlDebugClient into separate static library
Change-Id: Ib3daf9da2cf6798bd022cfcf54d11e565c9cb4ca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared/debugutil.cpp')
-rw-r--r--tests/auto/qml/debugger/shared/debugutil.cpp50
1 files changed, 46 insertions, 4 deletions
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp
index 51d706b818..54720fc848 100644
--- a/tests/auto/qml/debugger/shared/debugutil.cpp
+++ b/tests/auto/qml/debugger/shared/debugutil.cpp
@@ -33,10 +33,12 @@
#include "debugutil_p.h"
-#include <QEventLoop>
-#include <QTimer>
-#include <QFileInfo>
-#include <QDir>
+#include <private/qqmldebugconnection_p.h>
+
+#include <QtCore/qeventloop.h>
+#include <QtCore/qtimer.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qdir.h>
bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) {
QEventLoop loop;
@@ -51,6 +53,46 @@ bool QQmlDebugTest::waitForSignal(QObject *receiver, const char *member, int tim
return timer.isActive();
}
+QList<QQmlDebugClient *> QQmlDebugTest::createOtherClients(QQmlDebugConnection *connection)
+{
+ QList<QQmlDebugClient *> ret;
+ foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices()) {
+ if (!connection->client(service))
+ ret << new QQmlDebugClient(service, connection);
+ }
+ foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices()) {
+ if (!connection->client(service))
+ ret << new QQmlDebugClient(service, connection);
+ }
+ foreach (const QString &service, QQmlDebuggingEnabler::profilerServices()) {
+ if (!connection->client(service))
+ ret << new QQmlDebugClient(service, connection);
+ }
+ return ret;
+}
+
+QString QQmlDebugTest::clientStateString(const QQmlDebugClient *client)
+{
+ if (!client)
+ return QLatin1String("null");
+
+ switch (client->state()) {
+ case QQmlDebugClient::NotConnected: return QLatin1String("Not connected");
+ case QQmlDebugClient::Unavailable: return QLatin1String("Unavailable");
+ case QQmlDebugClient::Enabled: return QLatin1String("Enabled");
+ default: return QLatin1String("Invalid");
+ }
+
+}
+
+QString QQmlDebugTest::connectionStateString(const QQmlDebugConnection *connection)
+{
+ if (!connection)
+ return QLatin1String("null");
+
+ return connection->isConnected() ? QLatin1String("connected") : QLatin1String("not connected");
+}
+
QQmlDebugTestClient::QQmlDebugTestClient(const QString &s, QQmlDebugConnection *c)
: QQmlDebugClient(s, c)
{