diff options
author | Simjees Abraham <simjees.abraham@nokia.com> | 2012-05-25 09:02:44 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-30 12:07:19 +0200 |
commit | f50afbad6c6f8f4241db3c1d40c74c3aaa1fda83 (patch) | |
tree | 889eec0b0a5522756997a014cdcc34f62bf701d1 /tests/auto/qml/debugger/qqmlinspector | |
parent | f653c2b1bb8ac7bae7ff4412485a8910db5c94bd (diff) |
Debugger: Clearing the ObjectReferenceHash
ObjectReferenceHash is cleared when the Qml file is reloaded.
Change-Id: I78da1d88cce2f04fe820f3af14b047cd562e90ed
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'tests/auto/qml/debugger/qqmlinspector')
-rw-r--r-- | tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro | 1 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 71 |
2 files changed, 2 insertions, 70 deletions
diff --git a/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro b/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro index 1d42dded0a..5849d6013f 100644 --- a/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro +++ b/tests/auto/qml/debugger/qqmlinspector/qqmlinspector.pro @@ -8,6 +8,7 @@ SOURCES += tst_qqmlinspector.cpp INCLUDEPATH += ../shared include(../../../shared/util.pri) +include(../shared/qqmlinspectorclient.pri) include(../shared/debugutil.pri) TESTDATA = data/* diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 5326a053b0..291939df48 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -48,42 +48,12 @@ #include "../shared/debugutil_p.h" #include "../../../shared/util.h" +#include "qqmlinspectorclient.h" #define PORT 3772 #define STR_PORT "3772" -class QQmlInspectorClient : public QQmlDebugClient -{ - Q_OBJECT - -public: - QQmlInspectorClient(QQmlDebugConnection *connection) - : QQmlDebugClient(QLatin1String("QmlInspector"), connection) - , m_showAppOnTop(false) - , m_requestId(0) - , m_requestResult(false) - , m_responseId(-1) - { - } - - void setShowAppOnTop(bool showOnTop); - void reloadQml(const QHash<QString, QByteArray> &changesHash); - -signals: - void responseReceived(); -protected: - void messageReceived(const QByteArray &message); - -private: - bool m_showAppOnTop; - int m_requestId; - -public: - bool m_requestResult; - int m_responseId; - int m_reloadRequestId; -}; class tst_QQmlInspector : public QQmlDataTest { @@ -112,45 +82,6 @@ private slots: void reloadQml(); }; - -void QQmlInspectorClient::setShowAppOnTop(bool showOnTop) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("request") << m_requestId++ - << QByteArray("showAppOnTop") << showOnTop; - - sendMessage(message); -} - -void QQmlInspectorClient::reloadQml(const QHash<QString, QByteArray> &changesHash) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - m_reloadRequestId = m_requestId; - - ds << QByteArray("request") << m_requestId++ - << QByteArray("reload") << changesHash; - - sendMessage(message); -} - -void QQmlInspectorClient::messageReceived(const QByteArray &message) -{ - QDataStream ds(message); - QByteArray type; - ds >> type; - - if (type != QByteArray("response")) { - qDebug() << "Unhandled message of type" << type; - return; - } - - m_requestResult = false; - ds >> m_responseId >> m_requestResult; - emit responseReceived(); -} - void tst_QQmlInspector::init() { const QString argument = "-qmljsdebugger=port:"STR_PORT",block"; |