Commit 7f963aa4 authored by Aurindam Jana's avatar Aurindam Jana Committed by Qt by Nokia

QmlEngineDebug: Rename to QmlEngineDebugClient in AutoTest

Change-Id: If20b53d2e47cdc4ed54df0d9360ae1b0566489c6
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent f3bec848
......@@ -39,10 +39,11 @@
**
****************************************************************************/
#ifndef QQMLENGINEDEBUG_H
#define QQMLENGINEDEBUG_H
#ifndef QQMLENGINEDEBUGCLIENT_H
#define QQMLENGINEDEBUGCLIENT_H
#include "qqmldebugclient.h"
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
......@@ -59,17 +60,13 @@ class QQmlDebugContextReference;
class QQmlDebugObjectReference;
class QQmlDebugFileReference;
class QQmlDebugEngineReference;
class QQmlEngineDebugPrivate;
class QQmlEngineDebug : public QObject
class QQmlEngineDebugClientPrivate;
class QQmlEngineDebugClient : public QQmlDebugClient
{
Q_OBJECT
public:
enum State { NotConnected, Unavailable, Enabled };
explicit QQmlEngineDebug(QQmlDebugConnection *, QObject * = 0);
~QQmlEngineDebug();
State state() const;
explicit QQmlEngineDebugClient(QQmlDebugConnection *);
~QQmlEngineDebugClient();
QQmlDebugPropertyWatch *addWatch(const QQmlDebugPropertyReference &,
QObject *parent = 0);
......@@ -100,14 +97,18 @@ public:
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
QQmlEngineDebugPrivate *getPrivate() const { return d; }
QQmlEngineDebugClientPrivate *getPrivate() const { return d; }
Q_SIGNALS:
void newObjects();
void stateChanged(State state);
void newState(State state);
protected:
void stateChanged(State status);
void messageReceived(const QByteArray &data);
private:
QQmlEngineDebugPrivate *d;
QQmlEngineDebugClientPrivate *d;
};
class QQmlDebugWatch : public QObject
......@@ -132,12 +133,12 @@ Q_SIGNALS:
void valueChanged(const QByteArray &name, const QVariant &value);
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
void setState(State);
State m_state;
int m_queryId;
QQmlEngineDebug *m_client;
QQmlEngineDebugClient *m_client;
int m_objectDebugId;
};
......@@ -150,7 +151,7 @@ public:
QString name() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugClient;
QString m_name;
};
......@@ -163,7 +164,7 @@ public:
QString expression() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugClient;
QString m_expr;
int m_debugId;
};
......@@ -185,8 +186,8 @@ protected:
QQmlDebugQuery(QObject *);
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
void setState(State);
State m_state;
};
......@@ -206,7 +207,7 @@ public:
void setColumnNumber(int);
private:
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClientPrivate;
QUrl m_url;
int m_lineNumber;
int m_columnNumber;
......@@ -224,7 +225,7 @@ public:
QString name() const;
private:
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClientPrivate;
int m_debugId;
QString m_name;
};
......@@ -249,7 +250,7 @@ public:
QList<QQmlDebugObjectReference> children() const;
private:
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClientPrivate;
int m_debugId;
QString m_class;
QString m_idString;
......@@ -274,7 +275,7 @@ public:
QList<QQmlDebugContextReference> contexts() const;
private:
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClientPrivate;
int m_debugId;
QString m_name;
QList<QQmlDebugObjectReference> m_objects;
......@@ -296,7 +297,7 @@ public:
bool hasNotifySignal() const;
private:
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClientPrivate;
int m_objectDebugId;
QString m_name;
QVariant m_value;
......@@ -313,10 +314,10 @@ public:
virtual ~QQmlDebugEnginesQuery();
QList<QQmlDebugEngineReference> engines() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
QQmlDebugEnginesQuery(QObject *);
QQmlEngineDebug *m_client;
QQmlEngineDebugClient *m_client;
int m_queryId;
QList<QQmlDebugEngineReference> m_engines;
};
......@@ -328,10 +329,10 @@ public:
virtual ~QQmlDebugRootContextQuery();
QQmlDebugContextReference rootContext() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
QQmlDebugRootContextQuery(QObject *);
QQmlEngineDebug *m_client;
QQmlEngineDebugClient *m_client;
int m_queryId;
QQmlDebugContextReference m_context;
};
......@@ -343,10 +344,10 @@ public:
virtual ~QQmlDebugObjectQuery();
QQmlDebugObjectReference object() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
QQmlDebugObjectQuery(QObject *);
QQmlEngineDebug *m_client;
QQmlEngineDebugClient *m_client;
int m_queryId;
QQmlDebugObjectReference m_object;
......@@ -360,10 +361,10 @@ public:
QVariant expression() const;
QVariant result() const;
private:
friend class QQmlEngineDebug;
friend class QQmlEngineDebugPrivate;
friend class QQmlEngineDebugClient;
friend class QQmlEngineDebugClientPrivate;
QQmlDebugExpressionQuery(QObject *);
QQmlEngineDebug *m_client;
QQmlEngineDebugClient *m_client;
int m_queryId;
QVariant m_expr;
QVariant m_result;
......@@ -374,4 +375,4 @@ Q_DECLARE_METATYPE(QQmlDebugObjectReference)
Q_DECLARE_METATYPE(QQmlDebugContextReference)
Q_DECLARE_METATYPE(QQmlDebugPropertyReference)
#endif // QQMLENGINEDEBUG_H
#endif // QQMLENGINEDEBUGCLIENT_H
......@@ -2,7 +2,11 @@ CONFIG += testcase
TARGET = tst_qqmlenginedebugservice
macx:CONFIG -= app_bundle
SOURCES += tst_qqmlenginedebugservice.cpp
HEADERS += \
qqmlenginedebugclient.h
SOURCES += tst_qqmlenginedebugservice.cpp \
qqmlenginedebugclient.cpp
INCLUDEPATH += ../shared
include(../shared/debugutil.pri)
......
......@@ -59,7 +59,7 @@
#include <private/qqmlproperty_p.h>
#include "debugutil_p.h"
#include "qqmlenginedebug_p.h"
#include "qqmlenginedebugclient.h"
Q_DECLARE_METATYPE(QQmlDebugWatch::State)
......@@ -79,7 +79,7 @@ private:
void compareProperties(const QQmlDebugPropertyReference &a, const QQmlDebugPropertyReference &b) const;
QQmlDebugConnection *m_conn;
QQmlEngineDebug *m_dbg;
QQmlEngineDebugClient *m_dbg;
QQmlEngine *m_engine;
QQuickItem *m_rootItem;
......@@ -394,13 +394,12 @@ void tst_QQmlEngineDebugService::initTestCase()
bool ok = m_conn->waitForConnected();
QVERIFY(ok);
QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
m_dbg = new QQmlEngineDebug(m_conn, this);
QTRY_VERIFY(m_dbg->state() == QQmlEngineDebug::Enabled);
m_dbg = new QQmlEngineDebugClient(m_conn);
QTRY_VERIFY(m_dbg->state() == QQmlEngineDebugClient::Enabled);
}
void tst_QQmlEngineDebugService::cleanupTestCase()
{
delete m_dbg;
delete m_conn;
qDeleteAll(m_components);
delete m_engine;
......@@ -450,7 +449,7 @@ void tst_QQmlEngineDebugService::watch_property()
QQmlDebugPropertyWatch *watch;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
watch = unconnected->addWatch(prop, this);
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
delete watch;
......@@ -510,7 +509,7 @@ void tst_QQmlEngineDebugService::watch_object()
QQmlDebugWatch *watch;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
watch = unconnected->addWatch(obj, this);
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
delete watch;
......@@ -574,7 +573,7 @@ void tst_QQmlEngineDebugService::watch_expression()
QQmlDebugObjectExpressionWatch *watch;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
watch = unconnected->addWatch(obj, expr, this);
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
delete watch;
......@@ -653,7 +652,7 @@ void tst_QQmlEngineDebugService::queryAvailableEngines()
{
QQmlDebugEnginesQuery *q_engines;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
q_engines = unconnected->queryAvailableEngines(0);
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
delete q_engines;
......@@ -681,7 +680,7 @@ void tst_QQmlEngineDebugService::queryAvailableEngines()
delete m_dbg;
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
delete q_engines;
m_dbg = new QQmlEngineDebug(m_conn, this);
m_dbg = new QQmlEngineDebugClient(m_conn);
}
void tst_QQmlEngineDebugService::queryRootContexts()
......@@ -693,7 +692,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
QQmlDebugRootContextQuery *q_context;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
q_context = unconnected->queryRootContexts(engineId, this);
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
delete q_context;
......@@ -724,7 +723,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
delete m_dbg;
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
delete q_context;
m_dbg = new QQmlEngineDebug(m_conn, this);
m_dbg = new QQmlEngineDebugClient(m_conn);
}
void tst_QQmlEngineDebugService::queryObject()
......@@ -740,7 +739,7 @@ void tst_QQmlEngineDebugService::queryObject()
QQmlDebugObjectQuery *q_obj = 0;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this);
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
delete q_obj;
......@@ -763,7 +762,7 @@ void tst_QQmlEngineDebugService::queryObject()
delete m_dbg;
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
delete q_obj;
m_dbg = new QQmlEngineDebug(m_conn, this);
m_dbg = new QQmlEngineDebugClient(m_conn);
// check source as defined in main()
QQmlDebugFileReference source = obj.source();
......@@ -821,7 +820,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult()
QQmlDebugExpressionQuery *q_expr;
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
q_expr = unconnected->queryExpressionResult(objectId, expr, this);
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
delete q_expr;
......@@ -845,7 +844,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult()
delete m_dbg;
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
delete q_expr;
m_dbg = new QQmlEngineDebug(m_conn, this);
m_dbg = new QQmlEngineDebugClient(m_conn);
}
void tst_QQmlEngineDebugService::queryExpressionResult_data()
......
HEADERS += $$PWD/debugutil_p.h \
$$PWD/qqmldebugclient.h \
$$PWD/qqmlenginedebug_p.h \
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.h
SOURCES += $$PWD/debugutil.cpp \
$$PWD/qqmldebugclient.cpp \
$$PWD/qqmlenginedebug.cpp \
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.cpp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment